diff --git a/server/src/main/java/haengdong/event/config/S3Config.java b/server/src/main/java/haengdong/event/config/S3Config.java index ecf5e969..dee5499b 100644 --- a/server/src/main/java/haengdong/event/config/S3Config.java +++ b/server/src/main/java/haengdong/event/config/S3Config.java @@ -1,5 +1,6 @@ package haengdong.event.config; +import jakarta.annotation.PreDestroy; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.springframework.context.annotation.Bean; @@ -12,6 +13,8 @@ public class S3Config { private static final int THREAD_POOL_SIZE = 10; + private final ExecutorService executorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE); + @Bean public S3Client s3Client() { return S3Client.builder() @@ -21,6 +24,11 @@ public S3Client s3Client() { @Bean public ExecutorService executorService() { - return Executors.newFixedThreadPool(THREAD_POOL_SIZE); + return executorService; + } + + @PreDestroy + public void shutdown() { + executorService.shutdown(); } } diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index 4cf3c356..9c367306 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -9,6 +9,9 @@ spring: max-file-size: 50MB max-request-size: 300MB + lifecycle: + timeout-per-shutdown-phase: "10s" + h2: console: enabled: true @@ -69,6 +72,7 @@ server: enabled: true threads: max: 50 + shutdown: graceful kakao: base-uri: https://kauth.kakao.com diff --git a/server/src/main/resources/config b/server/src/main/resources/config index ca223b22..00d38ce6 160000 --- a/server/src/main/resources/config +++ b/server/src/main/resources/config @@ -1 +1 @@ -Subproject commit ca223b2257abe6ff0368e4982f0c98f9f4a55d61 +Subproject commit 00d38ce60ba6f4543a80d23e37dc28a48070c15b