This commit is contained in:
@@ -120,17 +120,18 @@ namespace AyaNova.Util
|
||||
|
||||
///////////////////////////////////////////
|
||||
//Verify that server exists
|
||||
// spend up to 5 minutes waiting for it to come up before bailing
|
||||
//
|
||||
internal static bool DatabaseServerExists(ILogger log, string logPrepend)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
//Try every 3 seconds for 10 tries before giving up
|
||||
//Try every 10 seconds for 30 tries before giving up (5 minutes total)
|
||||
|
||||
var maxRetryAttempts = 10;
|
||||
var pauseBetweenFailures = TimeSpan.FromSeconds(3);
|
||||
RetryHelper.RetryOnException(maxRetryAttempts, pauseBetweenFailures, log, logPrepend + AdminConnectionString, () =>
|
||||
var maxRetryAttempts = 30;
|
||||
var pauseBetweenFailures = TimeSpan.FromSeconds(10);
|
||||
RetryHelper.RetryOnException(maxRetryAttempts, pauseBetweenFailures, log, logPrepend + DisplayableConnectionString, () =>
|
||||
{
|
||||
using (var conn = new Npgsql.NpgsqlConnection(AdminConnectionString))
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace AyaNova.Util
|
||||
if (attempts == times)
|
||||
throw;
|
||||
|
||||
log.LogError(ex, $"{logPrepend} Exception caught on attempt {attempts} - will retry after delay {delay}");
|
||||
log.LogError(ex, $"{logPrepend} Exception caught on attempt {attempts} of {times} - will retry after delay {delay}");
|
||||
|
||||
Task.Delay(delay).Wait();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user