From 5128c892d011fa0bec093c40ba02d9ae7b39281d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=9A=A9=EC=88=98?= Date: Fri, 4 Oct 2024 13:39:04 +0900 Subject: [PATCH] =?UTF-8?q?Refactor:=20AI=20=EC=9A=94=EC=B2=AD=20=EC=84=9C?= =?UTF-8?q?=EB=B2=84=20=EC=8B=9C=EA=B0=84=EC=A0=9C=ED=95=9C=20=ED=95=B4?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/config/RestTemplateConfig.java | 20 +++++++++++++++++++ .../com/worlabel/global/config/WebConfig.java | 8 +------- 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 backend/src/main/java/com/worlabel/global/config/RestTemplateConfig.java diff --git a/backend/src/main/java/com/worlabel/global/config/RestTemplateConfig.java b/backend/src/main/java/com/worlabel/global/config/RestTemplateConfig.java new file mode 100644 index 0000000..20a9e6d --- /dev/null +++ b/backend/src/main/java/com/worlabel/global/config/RestTemplateConfig.java @@ -0,0 +1,20 @@ +package com.worlabel.global.config; + +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; + +import java.time.Duration; + +@Configuration +public class RestTemplateConfig { + + @Bean + public RestTemplate restTemplate(RestTemplateBuilder builder) { + return builder + .setConnectTimeout(Duration.ZERO) + .setReadTimeout(Duration.ZERO) + .build(); + } +} diff --git a/backend/src/main/java/com/worlabel/global/config/WebConfig.java b/backend/src/main/java/com/worlabel/global/config/WebConfig.java index 7116fc6..ced073e 100644 --- a/backend/src/main/java/com/worlabel/global/config/WebConfig.java +++ b/backend/src/main/java/com/worlabel/global/config/WebConfig.java @@ -2,9 +2,8 @@ package com.worlabel.global.config; import com.worlabel.global.resolver.CurrentUserArgumentResolver; import lombok.RequiredArgsConstructor; -import org.springframework.context.annotation.Bean; + import org.springframework.context.annotation.Configuration; -import org.springframework.web.client.RestTemplate; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -20,9 +19,4 @@ public class WebConfig implements WebMvcConfigurer { public void addArgumentResolvers(List resolvers) { resolvers.add(currentUserArgumentResolver); } - - @Bean - public RestTemplate restTemplate() { - return new RestTemplate(); - } }