File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/com/zufar/icedlatte/astartup Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ public class ApplicationMigration implements ApplicationRunner {
2929 @ Value ("${spring.aws.default-image-directory.products:}" )
3030 private String directoryPath ;
3131
32+ @ Value ("${migration.upload.enabled:true}" )
33+ private boolean uploadEnabled ;
34+
3235 private final FileUploader fileUploader ;
3336 private final AwsProvider awsProvider ;
3437 private final FileMetadataSaver fileMetadataSaver ;
@@ -51,7 +54,7 @@ public void run(ApplicationArguments args) {
5154 return ;
5255 }
5356 var executor = Executors .newVirtualThreadPerTaskExecutor ();
54- CompletableFuture .runAsync (this ::uploadFiles , executor )
57+ CompletableFuture .runAsync (uploadEnabled ? this ::uploadFiles : () -> log . info ( "migration.upload.skipped: reason=disabled" ) , executor )
5558 .thenComposeAsync (v -> CompletableFuture .supplyAsync (this ::fetchMetadata , executor ), executor )
5659 .thenAcceptAsync (this ::saveMetadata , executor )
5760 .orTimeout (5 , java .util .concurrent .TimeUnit .MINUTES )
You can’t perform that action at this time.
0 commit comments