add some connectivity changes

This commit is contained in:
Stanley Dimant
2022-07-10 22:20:48 +02:00
parent 2307b43c65
commit e36be97fdd
2 changed files with 3 additions and 3 deletions

View File

@@ -288,12 +288,12 @@ namespace MareSynchronos.WebAPI
return Task.CompletedTask; return Task.CompletedTask;
} }
private Task ConnectionHubOnReconnected(string? arg) private async Task ConnectionHubOnReconnected(string? arg)
{ {
Logger.Debug("Connection restored"); Logger.Debug("Connection restored");
await Task.Delay(TimeSpan.FromSeconds(new Random().Next(5, 10)));
_connectionDto = _connectionHub!.InvokeAsync<ConnectionDto>(ConnectionHubAPI.InvokeHeartbeat, _dalamudUtil.PlayerNameHashed).Result; _connectionDto = _connectionHub!.InvokeAsync<ConnectionDto>(ConnectionHubAPI.InvokeHeartbeat, _dalamudUtil.PlayerNameHashed).Result;
Connected?.Invoke(); Connected?.Invoke();
return Task.CompletedTask;
} }
private Task ConnectionHubOnReconnecting(Exception? arg) private Task ConnectionHubOnReconnecting(Exception? arg)

View File

@@ -7,6 +7,6 @@ public class ForeverRetryPolicy : IRetryPolicy
{ {
public TimeSpan? NextRetryDelay(RetryContext retryContext) public TimeSpan? NextRetryDelay(RetryContext retryContext)
{ {
return TimeSpan.FromSeconds(5); return TimeSpan.FromSeconds(new Random().Next(5, 20));
} }
} }