Explorar el Código

batch save partition

wangyunpeng hace 7 meses
padre
commit
2414cfe0f8

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

@@ -238,7 +238,9 @@ public class DataDashboardService {
                 BeanUtils.copyProperties(newSortStrategyExport, item);
                 saveList.add(item);
             }
-            crawlerBaseMapper.batchInsertDatastatSortStrategy(saveList);
+            for (List<DatastatSortStrategy> saveListPartition : Lists.partition(saveList, 1000)) {
+                crawlerBaseMapper.batchInsertDatastatSortStrategy(saveListPartition);
+            }
         }
         return result;
     }