Преглед изворни кода

new匹配小程序 去除并发

wangyunpeng пре 2 недеља
родитељ
комит
fb8e2f39b4

+ 12 - 6
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/NewMatchVideoServiceImpl.java

@@ -168,17 +168,23 @@ public class NewMatchVideoServiceImpl implements NewMatchVideoService {
     @Override
     public void matchCrawlerVideo() throws InterruptedException {
         List<NewMatchVideo> videos = queryMatchVideosByStatus(NewContentStatusEnum.KIMI_SUCCESS);
-        processVideosInParallel(videos,
-                this::processCrawlerMatchContent,
-                newMatchCrawlerVideoPoolExecutor);
+        if (CollectionUtils.isEmpty(videos)) {
+            return;
+        }
+        for (NewMatchVideo video : videos) {
+            processCrawlerMatchContent(video);
+        }
     }
 
     @Override
     public void uploadCrawlerVideo() throws InterruptedException {
         List<NewMatchVideo> videos = queryMatchVideosByStatus(NewContentStatusEnum.CRAWLER_SUCCESS);
-        processVideosInParallel(videos,
-                this::processUploadCrawlerVideo,
-                newUploadCrawlerVideoPoolExecutor);
+        if (CollectionUtils.isEmpty(videos)) {
+            return;
+        }
+        for (NewMatchVideo video : videos) {
+            processUploadCrawlerVideo(video);
+        }
     }
 
     private void processKimiMatchContent(NewMatchVideo newMatchVideo) {