|
@@ -260,7 +260,7 @@ public class MatchVideoServiceImpl {
|
|
|
page.setPageSize(pageSize);
|
|
|
example.setPage(page);
|
|
|
matchVideos = matchVideoMapper.selectByExample(example);
|
|
|
- matchKimiVideoQueue.addAll(matchVideos);
|
|
|
+ matchCrawlerVideoQueue.addAll(matchVideos);
|
|
|
pageNum++;
|
|
|
} while (CollectionUtils.isEmpty(matchVideos));
|
|
|
countDownLatch.await();
|
|
@@ -269,11 +269,13 @@ public class MatchVideoServiceImpl {
|
|
|
|
|
|
|
|
|
public void processCrawlerMatchContent(MatchVideo matchVideo) {
|
|
|
- if (matchVideo.getContentStatus() != 1 || matchVideo.getContentStatus() != 2) {
|
|
|
+ if (matchVideo.getContentStatus() != 1 && matchVideo.getContentStatus() != 2) {
|
|
|
return;
|
|
|
}
|
|
|
boolean existCrawlerVideo = crawlerVideoService.existCrawlerVideo(matchVideo.getContentId());
|
|
|
+ log.info("processCrawlerMatchContent contentId={} existCrawlerVideo={}", matchVideo.getContentId(), existCrawlerVideo);
|
|
|
if (!existCrawlerVideo) {
|
|
|
+ //查询相同的contentId,如果已经匹配失败,则直接更新状态为失败
|
|
|
MatchVideoExample example = new MatchVideoExample();
|
|
|
example.createCriteria().andContentIdEqualTo(matchVideo.getContentId());
|
|
|
List<MatchVideo> matchVideos = matchVideoMapper.selectByExample(example);
|
|
@@ -296,7 +298,7 @@ public class MatchVideoServiceImpl {
|
|
|
String rootContentId = getRootContentId(matchVideo.getContentId());
|
|
|
boolean res = crawlerVideoService.addCrawlerVideo(matchVideo.getContentId(), rootContentId, kimiText);
|
|
|
if (res) {
|
|
|
- updateStatus(matchVideo.getId(), 3);
|
|
|
+ updateStatus(matchVideo.getId(), ContentStatusEnum.SUCCESS_3.getStatusCode());
|
|
|
} else {
|
|
|
//匹配失败记录
|
|
|
String countKey = String.format(CRAWLER_COUNT_KEY, matchVideo.getContentId());
|