修复 重试机制后 多次接收任务导致内存泄露
This commit is contained in:
parent
8f4f48fd66
commit
b332fa742c
|
|
@ -230,14 +230,15 @@ namespace VideoAnalysisCore.Common
|
||||||
InsertChannel(lastEnum, oldTask);
|
InsertChannel(lastEnum, oldTask);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (Subscribe?.IsUnsubscribed == false)//排除重试机制后 多次接收任务导致内存泄露
|
||||||
|
return;
|
||||||
Subscribe = Redis.SubscribeList(RedisExpandKey.ChannelKey, (taskId) =>
|
Subscribe = Redis.SubscribeList(RedisExpandKey.ChannelKey, (taskId) =>
|
||||||
{
|
{
|
||||||
if (taskId is null) return;
|
if (taskId is null) return;
|
||||||
Subscribe?.Dispose();
|
Subscribe?.Dispose();
|
||||||
//存储当前机器的任务
|
//存储当前机器的任务
|
||||||
Redis.Set(RedisExpandKey.IDTask, taskId);
|
Redis.Set(RedisExpandKey.IDTask, taskId);
|
||||||
Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + "-> 接收到任务 " + taskId);
|
Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + "-------------> 接收到任务 " + taskId);
|
||||||
InsertChannel(RedisChannelEnum.DownloadFile, taskId);
|
InsertChannel(RedisChannelEnum.DownloadFile, taskId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue