Merge branch 'feature/file_stream' into 'feature/joint_log'
获取fileKey接口优化调整 See merge request infra/oss!53
This commit is contained in:
commit
f86f5f557d
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user