Skip to content

Commit 80ce9ca

Browse files
committed
fix: wait again for a break after shutdown is sent
1 parent 5caa232 commit 80ce9ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/WinService/Services/ShutdownService.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ private async Task CheckLifeSign(CancellationToken stoppingToken)
5252

5353
private async Task StartShutdownLoop(CancellationToken stoppingToken)
5454
{
55-
await Task.Delay(TimeSpan.FromMinutes(5), stoppingToken);
56-
if (await WaitUntilShutdownAsync(stoppingToken)) await SendShutdownAsync();
55+
await Task.Delay(TimeSpan.FromMinutes(5), stoppingToken);
56+
while (await WaitUntilShutdownAsync(stoppingToken))
57+
{
58+
await SendShutdownAsync();
59+
}
5760
}
5861

5962
/// <summary>

0 commit comments

Comments
 (0)