Skip to content

Commit

Permalink
Merge pull request dotnet#35127 from eerhardt/UpdateWorkerTemplate
Browse files Browse the repository at this point in the history
Remove unnecessary try-catch in Worker template
  • Loading branch information
eerhardt authored Aug 10, 2021
2 parents d937177 + 96b4876 commit e27bc83
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
while (!stoppingToken.IsCancellationRequested)
{
_logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);
try
{
await Task.Delay(1000, stoppingToken);
}
catch (OperationCanceledException)
{
return;
}
await Task.Delay(1000, stoppingToken);
}
}
}

0 comments on commit e27bc83

Please sign in to comment.