新增 NodeSubscriptionJob添加任务时去重
This commit is contained in:
parent
8847ae987b
commit
655ee7ea5f
|
|
@ -29,7 +29,7 @@ namespace Learn.VideoAnalysis.Expand
|
|||
//每5分钟执行一次 未处理视频扫描
|
||||
scheduler.Schedule<NodeSubscriptionJob>().EveryFiveMinutes();
|
||||
//文件包分析
|
||||
scheduler.Schedule<NodePackageJob>().HourlyAt(20);
|
||||
scheduler.Schedule<NodePackageJob>().HourlyAt(10);
|
||||
//任务缓存清理
|
||||
// scheduler.Schedule<TaskFileClearJob>().HourlyAt(10);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace VideoAnalysisCore.Job
|
|||
{
|
||||
Console.WriteLine($"{DateTime.Now} Invoke=>{this.GetType().FullName}");
|
||||
|
||||
var videoIdArr = videotaskDB.AsQueryable().Select(v => v.TagId).Distinct().ToArray();
|
||||
var tasks = await nodesubscriptionDB.GetListAsync(s => s.Enable && s.Subject ==SubjectEnum.数学);
|
||||
foreach (var item in tasks)
|
||||
{
|
||||
|
|
@ -78,6 +79,8 @@ namespace VideoAnalysisCore.Job
|
|||
var videos = new List<VideoTask>(data.Count);
|
||||
foreach (var s in data)
|
||||
{
|
||||
if (videoIdArr.Contains(s.VideoCode))
|
||||
continue;
|
||||
videos.Add(new VideoTask()
|
||||
{
|
||||
Id = YitIdHelper.NextId(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue