Преглед на файлове

待发布内容预过滤

wangyunpeng преди 4 седмици
родител
ревизия
04bf55776f

+ 6 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/XxlJobService.java

@@ -175,6 +175,9 @@ public class XxlJobService {
     @Value("${sync.publish.content.thread.pool.size:5}")
     private Integer syncPublishContentThreadPoolSize;
 
+    @Value("${preFilter.publish.content.thread.pool.size:4}")
+    private Integer preFilterPublishContentThreadPoolSize;
+
     @XxlJob("checkPublishPlan")
     public ReturnT<String> checkPublishPlan(String param) {
         Long todayStart = DateUtils.getTodayStart();
@@ -1121,7 +1124,7 @@ public class XxlJobService {
     public ReturnT<String> gzhWaitingPublishContentPreFilter(String param) {
         List<PublishPlanAccountDTO> planAccountList = longArticleBaseMapper.getGroupPublishPlanAccounts();
         ExecutorService thread = new CommonThreadPoolExecutor(
-                syncPublishContentThreadPoolSize, syncPublishContentThreadPoolSize, 0L, TimeUnit.SECONDS,
+                preFilterPublishContentThreadPoolSize, preFilterPublishContentThreadPoolSize, 0L, TimeUnit.SECONDS,
                 new LinkedBlockingQueue<>(),
                 new ThreadFactoryBuilder().setNameFormat("ContentPreFilter-%d").build(),
                 new ThreadPoolExecutor.AbortPolicy());
@@ -1150,6 +1153,8 @@ public class XxlJobService {
                             BeanUtils.copyProperties(filterContent, saveItem);
                             filterContentList.add(saveItem);
                         }
+                        log.info("ContentPreFilterJob success planId: {} accountId: {} filterContent: {}",
+                                item.getPlanId(), item.getAccountId(), filterContentList.size());
                         recommendService.updateWaitingContentFilter(filterContentList);
                     }
                 } finally {

+ 1 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/FilterService.java

@@ -22,7 +22,6 @@ import java.util.*;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 import static com.tzld.longarticle.recommend.server.common.constant.SceneConstants.FWH_COLD_START;
@@ -84,7 +83,7 @@ public class FilterService {
             futures.add(future);
         }
         try {
-            cdl.await(20000, TimeUnit.MILLISECONDS);
+            cdl.await();
         } catch (InterruptedException e) {
             log.error("filter error", e);
             return null;