Просмотр исходного кода

头条更新管家下所有账户

yumeng 1 год назад
Родитель
Сommit
9cbd6b9294

+ 6 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/AdminAdvertiserListServiceImpl.java

@@ -22,7 +22,7 @@ public class AdminAdvertiserListServiceImpl implements IAdminAdvertiserListServi
     private AdminAdvertiserListMapper adminAdvertiserListMapper;
     @Override
     public JSONObject bytedanceAdvertiserThreadPool(Integer totalPage, Integer pageSize, Long adminAdvertiserId, Long ccAccountId, String accessToken) {
-        ExecutorService executor = Executors.newFixedThreadPool(10);
+        ExecutorService executor = Executors.newFixedThreadPool(5);
         // 3. 创建线程安全的结果收集器
         List<Future<AdminAdvertiserListServiceImpl.PageResult>> futures = new ArrayList<>();
 
@@ -122,6 +122,11 @@ public class AdminAdvertiserListServiceImpl implements IAdminAdvertiserListServi
 
 
     private List<String> getBytedanceAccountList(Long adminAdvertiserId, Long ccAccountId, String accessToken, Integer page, Integer pageSize, Integer requestCount) {
+        try {
+            Thread.sleep(100);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
         if (requestCount > 3) {
             log.error("重试次数大于3次,跳出本页数据请求任务,adminAdvertiserId:{}", adminAdvertiserId);
             List<String> data = new ArrayList<>();