mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
更改了日志输出,更改了ChannelFlowTrigger存在的内存泄漏(取消超时机制)
This commit is contained in:
@@ -37,12 +37,20 @@ namespace Serein.Library.Utils
|
||||
try
|
||||
{
|
||||
await Task.Delay(outTime, cts.Token);
|
||||
await channel.Writer.WriteAsync(CancelType.Overtime);
|
||||
if(!cts.Token.IsCancellationRequested)
|
||||
{
|
||||
await channel.Writer.WriteAsync(CancelType.Overtime);
|
||||
}
|
||||
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
// 超时任务被取消
|
||||
}
|
||||
finally
|
||||
{
|
||||
cts?.Dispose();
|
||||
}
|
||||
}, cts.Token);
|
||||
|
||||
// 等待信号传入(超时或手动触发)
|
||||
|
||||
Reference in New Issue
Block a user