Przeglądaj źródła

Merge branch 'wyp/1220-bugFix' of Server/long-article-recommend into master

wangyunpeng 6 miesięcy temu
rodzic
commit
24a5cc4eee

+ 31 - 27
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleAuditService.java

@@ -91,35 +91,39 @@ public class ArticleAuditService {
                 .collect(Collectors.toMap(LongArticlesMatchVideo::getTraceId, Function.identity()));
         List<String> existsOssPath = longArticleBaseMapper.getExistsOssPath();
         for (String traceId : traceIds) {
-            LongArticlesMatchVideo longArticlesMatchVideo = longarticlesMatchVideoMap.get(traceId);
-            List<LongArticlesMatchVideoResponse> responseList = JSONArray.parseArray(longArticlesMatchVideo.getResponse()
-                    , LongArticlesMatchVideoResponse.class);
-            for (LongArticlesMatchVideoResponse response : responseList) {
-                String ossPath = getOssPath(response.getVideoPath());
-                if (existsOssPath.contains(ossPath)) {
-                    continue;
-                }
-                existsOssPath.add(ossPath);
-                LongArticleVideoAudit videoAudit = new LongArticleVideoAudit();
-                videoAudit.setVideoId(response.getVideoID());
-                videoAudit.setTraceId(traceId);
-                videoAudit.setContentId(longArticlesMatchVideo.getContentId());
-                videoAudit.setOssPath(ossPath);
-                videoAudit.setStatus(StatusEnum.ZERO.getCode());
-                videoAudit.setCreateTimestamp(System.currentTimeMillis());
-                longArticleVideoAuditRepository.save(videoAudit);
-                // 调用PQ 审核视频
-                try {
-                    Long taskId = pqVideoAuditStartProcessService.startProcess(response.getVideoID());
-                    if (Objects.nonNull(taskId)) {
-                        videoAudit.setTaskId(taskId);
-                        longArticleVideoAuditRepository.save(videoAudit);
-                    } else {
-                        log.error("PQVideoAuditStartProcess start process error videoId:{} ", response.getVideoID());
+            try {
+                LongArticlesMatchVideo longArticlesMatchVideo = longarticlesMatchVideoMap.get(traceId);
+                List<LongArticlesMatchVideoResponse> responseList = JSONArray.parseArray(longArticlesMatchVideo.getResponse()
+                        , LongArticlesMatchVideoResponse.class);
+                for (LongArticlesMatchVideoResponse response : responseList) {
+                    String ossPath = getOssPath(response.getVideoPath());
+                    if (existsOssPath.contains(ossPath)) {
+                        continue;
+                    }
+                    existsOssPath.add(ossPath);
+                    LongArticleVideoAudit videoAudit = new LongArticleVideoAudit();
+                    videoAudit.setVideoId(response.getVideoID());
+                    videoAudit.setTraceId(traceId);
+                    videoAudit.setContentId(longArticlesMatchVideo.getContentId());
+                    videoAudit.setOssPath(ossPath);
+                    videoAudit.setStatus(StatusEnum.ZERO.getCode());
+                    videoAudit.setCreateTimestamp(System.currentTimeMillis());
+                    longArticleVideoAuditRepository.save(videoAudit);
+                    // 调用PQ 审核视频
+                    try {
+                        Long taskId = pqVideoAuditStartProcessService.startProcess(response.getVideoID());
+                        if (Objects.nonNull(taskId)) {
+                            videoAudit.setTaskId(taskId);
+                            longArticleVideoAuditRepository.save(videoAudit);
+                        } else {
+                            log.error("PQVideoAuditStartProcess start process error videoId:{} ", response.getVideoID());
+                        }
+                    } catch (Exception e) {
+                        log.error("PQVideoAuditStartProcess start process videoId:{} error:{}", response.getVideoID(), e.getMessage());
                     }
-                } catch (Exception e) {
-                    log.error("PQVideoAuditStartProcess start process videoId:{} error:{}", response.getVideoID(), e.getMessage());
                 }
+            } catch (Exception e) {
+                log.error("articleVideoAudit traceId:{} error:{}", traceId, e.getMessage());
             }
         }