From 78b7360074b00a05915ebc3075923895e441f5fd Mon Sep 17 00:00:00 2001 From: Arachne <66822642+Arachneee@users.noreply.github.com> Date: Tue, 10 Dec 2024 19:18:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=A9=80=ED=8B=B0=EC=8A=A4=EB=A0=88?= =?UTF-8?q?=EB=93=9C=20=EC=A2=85=EB=A3=8C=20=EC=8B=9C=20=EC=9E=90=EC=9B=90?= =?UTF-8?q?=20=EB=B0=98=EB=82=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/haengdong/event/config/S3Config.java | 10 +++++++++- server/src/main/resources/application.yml | 4 ++++ server/src/main/resources/config | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) 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