Merge branch 'feature/joint_log' into 'pre'

Feature/joint log

See merge request infra/oss!56
This commit is contained in:
田立勇 2022-12-28 08:07:38 +00:00
commit 164a46e04a

View File

@ -357,10 +357,11 @@ public class FileServiceImpl implements FileService {
private void asyncSaveFile(List<FindFileKeyResponse> resList) {
List<CompletableFuture<Void>> completableFutures = new ArrayList<>(resList.size() / 10 + 1);
Lists.partition(resList, 10)
.forEach(findFileKeyResponses -> completableFutures.add(CompletableFuture.runAsync(
() -> findFileKeyResponses.forEach(response -> saveFile(response))
Lists.partition(resList, 10).forEach(findFileKeyResponses ->
completableFutures.add(CompletableFuture.runAsync(() ->
findFileKeyResponses.forEach(response -> saveFile(response))
)));
CompletableFuture.allOf(completableFutures.toArray(new CompletableFuture[0])).join();
}
private File saveFile(FindFileKeyResponse response) {