|
@@ -249,6 +249,7 @@ public class MatchVideoServiceImpl {
|
|
|
//更新状态为失败
|
|
|
LarkRobotUtil.sendMessage("kimiService updateKimiContent fail contentId=" + matchVideo.getContentId());
|
|
|
log.error("kimiService updateKimiContent fail contentId={}", matchVideo.getContentId());
|
|
|
+ kimiService.updateKimiContentStatus(matchVideo.getContentId(), 2);
|
|
|
updateStatus(matchVideo.getId(), ContentStatusEnum.ERROR_99.getStatusCode());
|
|
|
} else {
|
|
|
if (count == null) {
|
|
@@ -334,26 +335,30 @@ public class MatchVideoServiceImpl {
|
|
|
boolean lock = redisLock.tryLock(lockKey, lockValue, 20, TimeUnit.MINUTES);
|
|
|
if (lock) {
|
|
|
LongArticlesText kimiText = kimiService.getKimiText(matchVideo.getContentId());
|
|
|
- String rootContentId = getRootContentId(matchVideo.getContentId());
|
|
|
- boolean res = crawlerVideoService.addCrawlerVideo(matchVideo.getContentId(), rootContentId, kimiText);
|
|
|
- if (res) {
|
|
|
- updateStatus(matchVideo.getId(), ContentStatusEnum.CRAWLER_SUCCESS.getStatusCode());
|
|
|
- } else {
|
|
|
- //匹配失败记录
|
|
|
- String countKey = String.format(CRAWLER_FAIL_COUNT_KEY, matchVideo.getContentId());
|
|
|
- Integer count = (Integer) redisTemplate.opsForValue().get(countKey);
|
|
|
- if (count != null && count >= 3) {
|
|
|
- //更新状态为失败
|
|
|
- LarkRobotUtil.sendMessage("crawlerVideoService addCrawlerVideo fail contentId=" + matchVideo.getContentId());
|
|
|
- log.error("crawlerVideoService addCrawlerVideo fail contentId={}", matchVideo.getContentId());
|
|
|
- updateStatus(matchVideo.getId(), ContentStatusEnum.ERROR_99.getStatusCode());
|
|
|
+ if (kimiText.getKimiStatus() == 1) {
|
|
|
+ String rootContentId = getRootContentId(matchVideo.getContentId());
|
|
|
+ boolean res = crawlerVideoService.addCrawlerVideo(matchVideo.getContentId(), rootContentId, kimiText);
|
|
|
+ if (res) {
|
|
|
+ updateStatus(matchVideo.getId(), ContentStatusEnum.CRAWLER_SUCCESS.getStatusCode());
|
|
|
} else {
|
|
|
- if (count == null) {
|
|
|
- redisTemplate.opsForValue().set(countKey, 1, 3, TimeUnit.DAYS);
|
|
|
+ //匹配失败记录
|
|
|
+ String countKey = String.format(CRAWLER_FAIL_COUNT_KEY, matchVideo.getContentId());
|
|
|
+ Integer count = (Integer) redisTemplate.opsForValue().get(countKey);
|
|
|
+ if (count != null && count >= 3) {
|
|
|
+ //更新状态为失败
|
|
|
+ LarkRobotUtil.sendMessage("crawlerVideoService addCrawlerVideo fail contentId=" + matchVideo.getContentId());
|
|
|
+ log.error("crawlerVideoService addCrawlerVideo fail contentId={}", matchVideo.getContentId());
|
|
|
+ updateStatus(matchVideo.getId(), ContentStatusEnum.ERROR_99.getStatusCode());
|
|
|
} else {
|
|
|
- redisTemplate.opsForValue().set(countKey, count + 1, 3, TimeUnit.DAYS);
|
|
|
+ if (count == null) {
|
|
|
+ redisTemplate.opsForValue().set(countKey, 1, 3, TimeUnit.DAYS);
|
|
|
+ } else {
|
|
|
+ redisTemplate.opsForValue().set(countKey, count + 1, 3, TimeUnit.DAYS);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ } else if (kimiText.getKimiStatus() == 2) {
|
|
|
+ updateStatus(matchVideo.getId(), ContentStatusEnum.ERROR_99.getStatusCode());
|
|
|
}
|
|
|
redisLock.unlock(lockKey, lockValue);
|
|
|
}
|