Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] v3.0.0 배포 #829

Merged
merged 18 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: 멀티스레드 종료 시 자원 반납 추가
  • Loading branch information
Arachneee committed Dec 10, 2024
commit 78b7360074b00a05915ebc3075923895e441f5fd
10 changes: 9 additions & 1 deletion server/src/main/java/haengdong/event/config/S3Config.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
4 changes: 4 additions & 0 deletions server/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion server/src/main/resources/config
Loading