Skip to content

Commit f09df53

Browse files
author
Sophia Tevosyan
committed
changed startTime/endTime to startTimeUtc/endTimeUtc and made the request times DateTimeOffset
1 parent b7c7793 commit f09df53

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/Shared/Grpc/ProtoUtils.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -617,16 +617,16 @@ internal static void ToEntityBatchRequest(
617617
return new OperationResult()
618618
{
619619
Result = operationResult.Success.Result,
620-
StartTime = operationResult.Success.StartTime?.ToDateTime(),
621-
EndTime = operationResult.Success.EndTime?.ToDateTime(),
620+
StartTimeUtc = operationResult.Success.StartTimeUtc?.ToDateTime(),
621+
EndTimeUtc = operationResult.Success.EndTimeUtc?.ToDateTime(),
622622
};
623623

624624
case P.OperationResult.ResultTypeOneofCase.Failure:
625625
return new OperationResult()
626626
{
627627
FailureDetails = operationResult.Failure.FailureDetails.ToCore(),
628-
StartTime = operationResult.Failure.StartTime?.ToDateTime(),
629-
EndTime = operationResult.Failure.EndTime?.ToDateTime(),
628+
StartTimeUtc = operationResult.Failure.StartTimeUtc?.ToDateTime(),
629+
EndTimeUtc = operationResult.Failure.EndTimeUtc?.ToDateTime(),
630630
};
631631

632632
default:
@@ -654,8 +654,8 @@ internal static void ToEntityBatchRequest(
654654
Success = new P.OperationResultSuccess()
655655
{
656656
Result = operationResult.Result,
657-
StartTime = operationResult.StartTime?.ToTimestamp(),
658-
EndTime = operationResult.EndTime?.ToTimestamp(),
657+
StartTimeUtc = operationResult.StartTimeUtc?.ToTimestamp(),
658+
EndTimeUtc = operationResult.EndTimeUtc?.ToTimestamp(),
659659
},
660660
};
661661
}
@@ -666,8 +666,8 @@ internal static void ToEntityBatchRequest(
666666
Failure = new P.OperationResultFailure()
667667
{
668668
FailureDetails = ToProtobuf(operationResult.FailureDetails),
669-
StartTime = operationResult.StartTime?.ToTimestamp(),
670-
EndTime = operationResult.EndTime?.ToTimestamp(),
669+
StartTimeUtc = operationResult.StartTimeUtc?.ToTimestamp(),
670+
EndTimeUtc = operationResult.EndTimeUtc?.ToTimestamp(),
671671
},
672672
};
673673
}
@@ -696,7 +696,7 @@ internal static void ToEntityBatchRequest(
696696
Input = operationAction.SendSignal.Input,
697697
InstanceId = operationAction.SendSignal.InstanceId,
698698
ScheduledTime = operationAction.SendSignal.ScheduledTime?.ToDateTime(),
699-
RequestTime = operationAction.SendSignal.RequestTime?.ToDateTime(),
699+
RequestTime = operationAction.SendSignal.RequestTime?.ToDateTimeOffset(),
700700
ParentTraceContext = operationAction.SendSignal.ParentTraceContext != null ?
701701
new DistributedTraceContext(
702702
operationAction.SendSignal.ParentTraceContext.TraceParent,
@@ -712,7 +712,7 @@ internal static void ToEntityBatchRequest(
712712
InstanceId = operationAction.StartNewOrchestration.InstanceId,
713713
Version = operationAction.StartNewOrchestration.Version,
714714
ScheduledStartTime = operationAction.StartNewOrchestration.ScheduledTime?.ToDateTime(),
715-
RequestTime = operationAction.StartNewOrchestration.RequestTime?.ToDateTime(),
715+
RequestTime = operationAction.StartNewOrchestration.RequestTime?.ToDateTimeOffset(),
716716
ParentTraceContext = operationAction.StartNewOrchestration.ParentTraceContext != null ?
717717
new DistributedTraceContext(
718718
operationAction.StartNewOrchestration.ParentTraceContext.TraceParent,

src/Worker/Core/Shims/TaskEntityShim.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public override async Task<EntityBatchResult> ExecuteOperationBatchAsync(EntityB
7474
results.Add(new OperationResult()
7575
{
7676
Result = serializedResult,
77-
StartTime = startTime,
78-
EndTime = DateTime.UtcNow,
77+
StartTimeUtc = startTime,
78+
EndTimeUtc = DateTime.UtcNow,
7979
});
8080

8181
// the user code completed without exception, so we commit the current state and actions.
@@ -88,8 +88,8 @@ public override async Task<EntityBatchResult> ExecuteOperationBatchAsync(EntityB
8888
results.Add(new OperationResult()
8989
{
9090
FailureDetails = new FailureDetails(applicationException),
91-
StartTime = startTime,
92-
EndTime = DateTime.UtcNow,
91+
StartTimeUtc = startTime,
92+
EndTimeUtc = DateTime.UtcNow,
9393
});
9494

9595
// the user code threw an unhandled exception, so we roll back the state and the actions.
@@ -232,7 +232,7 @@ public override void SignalEntity(EntityInstanceId id, string operationName, obj
232232
Name = operationName,
233233
Input = this.dataConverter.Serialize(input),
234234
ScheduledTime = options?.SignalTime?.UtcDateTime,
235-
RequestTime = DateTime.UtcNow,
235+
RequestTime = DateTimeOffset.UtcNow,
236236
ParentTraceContext = this.parentTraceContext,
237237
});
238238
}
@@ -249,7 +249,7 @@ public override string ScheduleNewOrchestration(TaskName name, object? input = n
249249
InstanceId = instanceId,
250250
Input = this.dataConverter.Serialize(input),
251251
ScheduledStartTime = options?.StartAt?.UtcDateTime,
252-
RequestTime = DateTime.UtcNow,
252+
RequestTime = DateTimeOffset.UtcNow,
253253
ParentTraceContext = this.parentTraceContext,
254254
});
255255
return instanceId;

0 commit comments

Comments
 (0)