|
@@ -259,6 +259,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
String imageNumPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
String imageNumPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
ExecutorService executorService = Executors.newFixedThreadPool(10);
|
|
List<String> qtFilePaths = new ArrayList<>();
|
|
List<String> qtFilePaths = new ArrayList<>();
|
|
|
|
+ List<Future> futureList = new ArrayList<>();
|
|
for (String filePath : ossFilePaths) {
|
|
for (String filePath : ossFilePaths) {
|
|
Callable<Boolean> call = new Callable() {
|
|
Callable<Boolean> call = new Callable() {
|
|
@Override
|
|
@Override
|
|
@@ -267,7 +268,7 @@ public class SceneDownloadHandlerServiceImpl {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- executorService.submit(call);
|
|
|
|
|
|
+ futureList.add(executorService.submit(call));
|
|
}
|
|
}
|
|
// List<Future> futureList = new ArrayList<>();
|
|
// List<Future> futureList = new ArrayList<>();
|
|
// for (String filePath : qtFilePaths) {
|
|
// for (String filePath : qtFilePaths) {
|
|
@@ -283,9 +284,9 @@ public class SceneDownloadHandlerServiceImpl {
|
|
// };
|
|
// };
|
|
// futureList.add(executorService.submit(call));
|
|
// futureList.add(executorService.submit(call));
|
|
// }
|
|
// }
|
|
-// for (Future future : futureList) {
|
|
|
|
-// future.get();
|
|
|
|
-// }
|
|
|
|
|
|
+ for (Future future : futureList) {
|
|
|
|
+ future.get();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void test(ZipOutputStream out, List<String> ossFilePaths,
|
|
private void test(ZipOutputStream out, List<String> ossFilePaths,
|