Refactor journal data access and improve byte[] handling (#5878)
Switched to dictionary index access for "ResumeAt" in Delay.cs to ensure more efficient updating. Added handling for byte[] in ObjectConverter.cs to correctly deserialize from base64 strings.
This commit is contained in:
parent
b6acb18dc6
commit
ef2dfd3957
|
|
@ -112,7 +112,13 @@ public static class ObjectConverter
|
|||
if (underlyingSourceType == typeof(string) && !underlyingTargetType.IsPrimitive && underlyingTargetType != typeof(object))
|
||||
{
|
||||
var stringValue = (string)value;
|
||||
|
||||
|
||||
if (underlyingTargetType == typeof(byte[]))
|
||||
{
|
||||
// Byte arrays are serialized to base64, so in this case, we convert the string back to the requested target type of byte[].
|
||||
return Convert.FromBase64String(stringValue);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var firstChar = stringValue.TrimStart().FirstOrDefault();
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class Delay : Activity, IActivityPropertyDefaultValueProvider
|
|||
var resumeAt = clock.UtcNow.Add(timeSpan);
|
||||
var payload = new DelayPayload(resumeAt);
|
||||
|
||||
context.JournalData.Add("ResumeAt", resumeAt);
|
||||
context.JournalData["ResumeAt"] = resumeAt;
|
||||
context.CreateBookmark(payload);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue