Skip to content

Commit

Permalink
Fix issue I was experiencing in my time zone (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist authored and martincostello committed Sep 28, 2023
1 parent a7defaa commit 0aa6a1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ internal static async ValueTask ExecuteScheduledTaskAsync(Task? task, Resilience

private static bool IsDateTimeOverflow(DateTimeOffset utcNow, TimeSpan breakDuration)
{
TimeSpan maxDifference = DateTime.MaxValue - utcNow;
TimeSpan maxDifference = DateTimeOffset.MaxValue - utcNow;

// stryker disable once equality : no means to test this
return breakDuration > maxDifference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public async Task OnActionFailureAsync_EnsureBreakDurationNotOverflow(bool overf
using var controller = CreateController();
var shouldBreak = true;
await TransitionToState(controller, CircuitState.HalfOpen);
var utcNow = DateTime.MaxValue - _options.BreakDuration;
var utcNow = DateTimeOffset.MaxValue - _options.BreakDuration;
if (overflow)
{
utcNow += TimeSpan.FromMilliseconds(10);
Expand Down

0 comments on commit 0aa6a1a

Please sign in to comment.