瀏覽代碼

Add try catch on Dispatcher.Processing when invoke subscriber (#900)

* Fix Dashboard metric not update #811

* Add try catch on Dispatcher.Processing when invoke subscriber
master
luox78 3 年之前
committed by GitHub
父節點
當前提交
1bc1595a97
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 9 行新增1 行删除
  1. +9
    -1
      src/DotNetCore.CAP/Processor/IDispatcher.Default.cs

+ 9
- 1
src/DotNetCore.CAP/Processor/IDispatcher.Default.cs 查看文件

@@ -98,7 +98,15 @@ namespace DotNetCore.CAP.Processor
{
while (_receivedChannel.Reader.TryRead(out var message))
{
await _executor.DispatchAsync(message.Item1, message.Item2, _cts.Token);
try
{
await _executor.DispatchAsync(message.Item1, message.Item2, _cts.Token);
}
catch (Exception e)
{
_logger.LogError(e,
$"An exception occurred when invoke subscriber. MessageId:{message.Item1.DbId}");
}
}
}
}


Loading…
取消
儲存