catch cancled task exception in notif

This commit is contained in:
Kukks 2020-06-26 11:54:18 +02:00
parent dc43b54892
commit a0065bc2ba

View File

@ -78,7 +78,7 @@ namespace BTCPayServer.Controllers
IEventAggregatorSubscription subscription = null;
try
{
subscription = _eventAggregator.Subscribe<UserNotificationsUpdatedEvent>(async evt =>
subscription = _eventAggregator.Subscribe<UserNotificationsUpdatedEvent>(async evt =>
{
if (evt.UserId == userId)
{
@ -91,6 +91,10 @@ namespace BTCPayServer.Controllers
await Task.Delay(2000, cancellationToken);
}
}
catch(TaskCanceledException)
{
// ignored
}
finally
{
subscription?.Dispose();