Skip to content

Commit

Permalink
Add delay to ClaimAutomationHandler retries (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahma19 authored Jan 30, 2025
1 parent ed4554a commit 95bbee1
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public async Task Consume(ConsumeContext<ClaimCertificateCommand> context)
catch (QuantityNotYetAvailableToReserveException ex)
{
_unitOfWork.Rollback();
// Add jitter to delay the retry
await Task.Delay(TimeSpan.FromSeconds(Random.Shared.Next(5, 10)));
_logger.LogWarning(ex, "Failed to handle claim at this time.");
throw;
}
Expand Down

0 comments on commit 95bbee1

Please sign in to comment.