randomize reconnection delay when failed to establish connection

This commit is contained in:
Stanley Dimant
2022-07-10 22:22:42 +02:00
parent e36be97fdd
commit 4959633242

View File

@@ -246,7 +246,7 @@ namespace MareSynchronos.WebAPI
Logger.Warn(ex.StackTrace ?? string.Empty);
Logger.Debug("Failed to establish connection, retrying");
await StopAllConnections(token);
await Task.Delay(TimeSpan.FromSeconds(5), token);
await Task.Delay(TimeSpan.FromSeconds(new Random().Next(5, 20)), token);
}
}
}