Skip to content

Commit

Permalink
Simplify DelayDeactivation logic (#8712)
Browse files Browse the repository at this point in the history
Co-authored-by: b.nichvolodov <[email protected]>
  • Loading branch information
2 people authored and ReubenBond committed Nov 11, 2023
1 parent cd1aebc commit e94f117
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Orleans.Runtime/Catalog/ActivationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,16 +396,16 @@ internal List<Message> DequeueAllWaitingRequests()

public void DelayDeactivation(TimeSpan timespan)
{
if (timespan <= TimeSpan.Zero && timespan != Timeout.InfiniteTimeSpan)
{
// reset any current keepAliveUntil
ResetKeepAliveRequest();
}
else if (timespan == TimeSpan.MaxValue || timespan == Timeout.InfiniteTimeSpan)
if (timespan == TimeSpan.MaxValue || timespan == Timeout.InfiniteTimeSpan)
{
// otherwise creates negative time.
KeepAliveUntil = DateTime.MaxValue;
}
else if (timespan <= TimeSpan.Zero)
{
// reset any current keepAliveUntil
ResetKeepAliveRequest();
}
else
{
KeepAliveUntil = DateTime.UtcNow + timespan;
Expand Down

0 comments on commit e94f117

Please sign in to comment.