We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3de8e22 commit 1826009Copy full SHA for 1826009
docs/core/extensions/snippets/workers/windows-service/WindowsBackgroundService.cs
@@ -20,17 +20,10 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
20
{
21
while (!stoppingToken.IsCancellationRequested)
22
23
- try
24
- {
25
- string joke = await _jokeService.GetJokeAsync();
26
- _logger.LogWarning(joke);
+ string joke = await _jokeService.GetJokeAsync();
+ _logger.LogWarning(joke);
27
28
- await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken);
29
- }
30
- catch (OperationCanceledException)
31
32
- break;
33
+ await Task.Delay(TimeSpan.FromMinutes(1), stoppingToken);
34
}
35
36
0 commit comments