修改铭牌的重试方法
This commit is contained in:
@@ -110,18 +110,16 @@ public class TmNameplateCorpusServiceImpl extends ServiceImpl<TmNameplateCorpusM
|
||||
for (int i = 1; i <= totalPages; i++) {
|
||||
int offset = (i - 1) * pageSize;
|
||||
List<TmNameplateCorpus> messageList = tmNameplateCorpusMapper.queryTmNameplateCorpusRetry(statTime, endTime, offset, pageSize, customerFlowIds, retry);
|
||||
// 处理查询到的数据
|
||||
// 使用 CompletableFuture 并行处理
|
||||
CompletableFuture<?>[] futures = messageList.stream()
|
||||
.map(item -> CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
processItem(item);
|
||||
} catch (Exception e) {
|
||||
log.error("重跑铭牌语料失败: customerFlowId={}, AcceptUserId={}, 异常: {}",
|
||||
item.getCustomerFlowId(), e.getMessage(), e);
|
||||
}
|
||||
}, executor))
|
||||
.toArray(CompletableFuture[]::new);
|
||||
for(TmNameplateCorpus tmNameplateCorpus :messageList){
|
||||
CompletableFuture.runAsync(() -> {
|
||||
try {
|
||||
processItem(tmNameplateCorpus);
|
||||
} catch (Exception e) {
|
||||
log.error("重跑铭牌语料失败: customerFlowId={}, AcceptUserId={}, 异常: {}",
|
||||
tmNameplateCorpus.getCustomerFlowId(), e.getMessage(), e);
|
||||
}
|
||||
}, executor);
|
||||
}
|
||||
}
|
||||
log.info("重跑铭牌语料铭牌数据跑批结束 耗时:{}",System.currentTimeMillis()-startTime);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user