修复 ppt类型文件分析完成回调失败
This commit is contained in:
parent
8ed02b9a79
commit
7ca52f3c97
|
|
@ -102,6 +102,9 @@ namespace VideoAnalysisCore.Controllers
|
|||
continue;
|
||||
if (videoIdArr.Contains(s.VideoCode))
|
||||
continue;
|
||||
var pptInfo = req.AnalyzeItems //»ñÈ¡ppt videoCode
|
||||
.FirstOrDefault(x => x.AttachmentsInfoType == AttachmentsInfoType.PPT && s.StructurePageContentId == x.StructurePageContentId);
|
||||
var pptCode = pptInfo?.VideoCode ?? (pptInfo?.VideoUrl??string.Empty);
|
||||
videos.Add(new VideoTask()
|
||||
{
|
||||
Id = YitIdHelper.NextId(),
|
||||
|
|
@ -112,9 +115,7 @@ namespace VideoAnalysisCore.Controllers
|
|||
TagId = s.VideoCode,
|
||||
MediaUrl =s.VideoUrl,
|
||||
MediaName = s.VideoName,
|
||||
PPTVideoCode = req.AnalyzeItems //»ñÈ¡ppt videoCode
|
||||
.FirstOrDefault(x => x.AttachmentsInfoType == AttachmentsInfoType.PPT && s.StructurePageContentId == x.StructurePageContentId)
|
||||
?.VideoCode,
|
||||
PPTVideoCode = pptCode,
|
||||
});
|
||||
}
|
||||
await nodePackageInfoDB.InsertRangeAsync(nodePackages);
|
||||
|
|
|
|||
|
|
@ -48,16 +48,21 @@ namespace VideoAnalysisCore.Job
|
|||
.Where(s => s.EndTime != null)
|
||||
.Select(s => s.TagId)
|
||||
.ToArrayAsync();
|
||||
|
||||
var videoPPTArr = await videoTaskDB.AsQueryable()
|
||||
.Where(s => s.EndTime != null)
|
||||
.Select(s => s.PPTVideoCode)
|
||||
.ToArrayAsync();
|
||||
var postData = new List<NodePackageInfo>();
|
||||
foreach (var item in taskArr)
|
||||
{
|
||||
if (videoIdArr.Contains(item.VideoCode))
|
||||
if (videoIdArr.Contains(item.VideoCode)|| videoPPTArr.Contains(item.VideoCode))
|
||||
{
|
||||
postData.Add(item);
|
||||
item.SuccessTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 已完成任务回调 数量{postData.Count}");
|
||||
Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 任务回调 数量{postData.Count} ...");
|
||||
if (postData.Count() == 0)
|
||||
return;
|
||||
//var responseMessage = await new HttpClient()
|
||||
|
|
@ -96,6 +101,7 @@ namespace VideoAnalysisCore.Job
|
|||
await Task.Delay(1000);
|
||||
}
|
||||
|
||||
Console.WriteLine($"{DateTime.Now} 执行=>文件包任务 已完成任务回调 数量{postData.Count}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue