mirror of
https://github.com/bitwarden/server
synced 2025-12-06 00:03:34 +00:00
Removed unused global settings and listenerlogger and passed cancelationtoken to Task.Delay methods (#1810)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,7 @@ public class DatabaseMigrationHostedService : IHostedService, IDisposable
|
|||||||
public virtual async Task StartAsync(CancellationToken cancellationToken)
|
public virtual async Task StartAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// Wait 20 seconds to allow database to come online
|
// Wait 20 seconds to allow database to come online
|
||||||
await Task.Delay(20000);
|
await Task.Delay(20000, cancellationToken);
|
||||||
|
|
||||||
var maxMigrationAttempts = 10;
|
var maxMigrationAttempts = 10;
|
||||||
for (var i = 1; i <= maxMigrationAttempts; i++)
|
for (var i = 1; i <= maxMigrationAttempts; i++)
|
||||||
@@ -41,7 +41,7 @@ public class DatabaseMigrationHostedService : IHostedService, IDisposable
|
|||||||
{
|
{
|
||||||
_logger.LogError(e,
|
_logger.LogError(e,
|
||||||
"Database unavailable for migration. Trying again (attempt #{0})...", i + 1);
|
"Database unavailable for migration. Trying again (attempt #{0})...", i + 1);
|
||||||
await Task.Delay(20000);
|
await Task.Delay(20000, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user