Skip to content

Commit

Permalink
Add a small buffer to DoMaintenanceAsync to account for system clock …
Browse files Browse the repository at this point in the history
…drift, see if this fixes flakey ci test.
  • Loading branch information
niemyjski committed Mar 20, 2024
1 parent 19af803 commit 01c723b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Foundatio/Queues/InMemoryQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ public override Task DeleteQueueAsync()
_logger.LogError(ex, "DoMaintenance Error: {Message}", ex.Message);
}

return minAbandonAt;
// Add a tiny buffer just in case the schedule next timer fires early.
// The system clock typically has a resolution of 10-15 milliseconds, so timers cannot be more accurate than this resolution.
return minAbandonAt.SafeAdd(TimeSpan.FromMilliseconds(10));
}

public override void Dispose()
Expand Down

0 comments on commit 01c723b

Please sign in to comment.