mirror of
https://github.com/bitwarden/server
synced 2025-12-30 07:03:42 +00:00
[BRE-1058] fix alpine race condition (#6156)
* alpine race condition during shutdown fix * change catch to only be for relevant task cancelled, added a debug log * test commit for build and test * remove testing comment
This commit is contained in:
@@ -86,11 +86,24 @@ public class AzureQueueHostedService : IHostedService, IDisposable
|
||||
await Task.Delay(TimeSpan.FromSeconds(5), cancellationToken);
|
||||
}
|
||||
}
|
||||
catch (TaskCanceledException) when (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
_logger.LogDebug("Task.Delay cancelled during Alpine container shutdown");
|
||||
break;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "Error occurred processing message block.");
|
||||
|
||||
await Task.Delay(TimeSpan.FromSeconds(5), cancellationToken);
|
||||
try
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(5), cancellationToken);
|
||||
}
|
||||
catch (TaskCanceledException) when (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
_logger.LogDebug("Task.Delay cancelled during Alpine container shutdown");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user