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

修改头条快手爆款视频计算逻辑

songyh пре 4 година
родитељ
комит
574f818986

+ 3 - 18
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouDailyAccountReportLoadJob.java

@@ -25,8 +25,8 @@ public class KuaishouDailyAccountReportLoadJob {
     private ICtopOauthTokenService tokenService;
     @Autowired
     private IKuaishouInterfaceService kuaishouInterfaceService;
-    static ExecutorService executorService = Executors.newFixedThreadPool(3);
-    static ExecutorService currentExecutorService = Executors.newFixedThreadPool(5);
+    static ExecutorService executorService = Executors.newFixedThreadPool(10);
+    static ExecutorService adSceneExecutorService = Executors.newFixedThreadPool(10);
 
     @XxlJob("kuaishouDailyAccountReport")
     public void execute() throws Exception {
@@ -44,21 +44,6 @@ public class KuaishouDailyAccountReportLoadJob {
         }));
     }
 
-    @XxlJob("kuaishouCurrentDailyAccountReport")
-    public void kuaishouCurrentDailyAccountReport() throws Exception {
-        Date getDate = new Date();
-        //1:查询当日数据
-        List<CtopOauthToken> tokens = tokenService.selectKuaiShouToken();
-        if (null == tokens || tokens.isEmpty()) {
-            XxlJobHelper.log("定时获取快手数据异常:未获取到可用的token");
-            XxlJobHelper.handleFail();
-            return;
-        }
-        tokens.forEach(token -> currentExecutorService.submit(() -> {
-            kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate, getDate, null);
-        }));
-    }
-
     @XxlJob("kuaishouDailyAccountAdSceneReport")
     public void kuaishouDailyAccountAdSceneReport() throws Exception {
         Date getDate = DateUtils.addDay(new Date(), -1);
@@ -70,7 +55,7 @@ public class KuaishouDailyAccountReportLoadJob {
             XxlJobHelper.handleFail();
             return;
         }
-        tokens.forEach(token -> executorService.submit(() -> {
+        tokens.forEach(token -> adSceneExecutorService.submit(() -> {
             kuaishouInterfaceService.getAdvertiserReportDaily(token, getDate2, getDate, "adScene");
         }));
     }