瀏覽代碼

Fixed asynchronous exception catching bug of sending.

master
Savorboard 5 年之前
父節點
當前提交
d1c26b75bd
共有 1 個檔案被更改,包括 8 行新增8 行删除
  1. +8
    -8
      src/DotNetCore.CAP/Processor/IDispatcher.Default.cs

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

@@ -59,17 +59,17 @@ namespace DotNetCore.CAP.Processor
{
if (_publishedMessageQueue.TryTake(out var message, 3000, _cts.Token))
{
try
Task.Run(async () =>
{
Task.Run(async () =>
try
{
await _sender.SendAsync(message);
});
}
catch (Exception ex)
{
_logger.LogError(ex, $"An exception occurred when sending a message to the MQ. Topic:{message.Name}, Id:{message.Id}");
}
}
catch (Exception ex)
{
_logger.LogError(ex, $"An exception occurred when sending a message to the MQ. Topic:{message.Name}, Id:{message.Id}");
}
});
}
}
}


Loading…
取消
儲存