Skip to content

Commit

Permalink
Change to a start delay
Browse files Browse the repository at this point in the history
  • Loading branch information
paullocknimble committed Nov 6, 2024
1 parent 4a237e2 commit 6b06d26
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ public CreateCompleteProjectsService(ILogger<CreateCompleteProjectsService> logg
{
_logger = logger;
_factory = factory;
_delayInMilliseconds = GetSecureRandomDelay(1000, 30000) + config.GetValue<int?>("SendProjectsToCompletePollingDelay") ?? 60_000;
_delayInMilliseconds = config.GetValue<int?>("SendProjectsToCompletePollingDelay") ?? 60_000;
}

protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
// delay start to prevent runtime colisions
var startDelayInMilliseconds = GetSecureRandomDelay(1000, 60000);

await Task.Delay(startDelayInMilliseconds, stoppingToken);

while (!stoppingToken.IsCancellationRequested)
{
using (var scope = _factory.CreateScope())
Expand Down

0 comments on commit 6b06d26

Please sign in to comment.