Skip to content

Commit

Permalink
Remove unnecessary try-catch in Worker template
Browse files Browse the repository at this point in the history
This was working around a bug in 6.0 (dotnet/runtime#56032) which will be fixed in 6.0. So we no longer need this in the default template.
  • Loading branch information
eerhardt committed Aug 6, 2021
1 parent a1da5e9 commit 96b4876
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 96b4876

Please sign in to comment.