|
|
|
@ -80,10 +80,7 @@ namespace Squidex.Infrastructure.EventSourcing |
|
|
|
|
|
|
|
if (retryWindow.CanRetryAfterFailure()) |
|
|
|
{ |
|
|
|
Task.Delay(ReconnectWaitMs, timerCts.Token).ContinueWith(t => |
|
|
|
{ |
|
|
|
dispatcher.DispatchAsync(Subscribe); |
|
|
|
}).Forget(); |
|
|
|
RetryAsync().Forget(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
@ -92,6 +89,13 @@ namespace Squidex.Infrastructure.EventSourcing |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private async Task RetryAsync() |
|
|
|
{ |
|
|
|
await Task.Delay(ReconnectWaitMs, timerCts.Token); |
|
|
|
|
|
|
|
await dispatcher.DispatchAsync(Subscribe); |
|
|
|
} |
|
|
|
|
|
|
|
Task IEventSubscriber.OnEventAsync(IEventSubscription subscription, StoredEvent storedEvent) |
|
|
|
{ |
|
|
|
return dispatcher.DispatchAsync(() => HandleEventAsync(subscription, storedEvent)); |
|
|
|
|