From 4ba5ee7e5d385892558d9f4ca619d732b2eed572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=84=9C=EC=9D=80?= <61147083+BangSun98@users.noreply.github.com> Date: Wed, 18 Jun 2025 11:22:49 +0900 Subject: [PATCH] fix timeout error --- .../smarketing/content/config/WebClientConfig.java | 4 ++-- .../external/ClaudeAiContentGenerator.java | 14 ++------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/config/WebClientConfig.java b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/config/WebClientConfig.java index 7f7cf08..72e1a78 100644 --- a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/config/WebClientConfig.java +++ b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/config/WebClientConfig.java @@ -20,8 +20,8 @@ public class WebClientConfig { @Bean public WebClient webClient() { HttpClient httpClient = HttpClient.create() - .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000) - .responseTimeout(Duration.ofMillis(30000)); + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 50000) + .responseTimeout(Duration.ofMillis(300000)); return WebClient.builder() .clientConnector(new ReactorClientHttpConnector(httpClient)) diff --git a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/ClaudeAiContentGenerator.java b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/ClaudeAiContentGenerator.java index 7243c26..bb6abdf 100644 --- a/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/ClaudeAiContentGenerator.java +++ b/smarketing-java/marketing-content/src/main/java/com/won/smarketing/content/infrastructure/external/ClaudeAiContentGenerator.java @@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpMethod; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.client.WebClient; - import java.time.Duration; import java.util.HashMap; import java.util.Map; @@ -44,15 +43,10 @@ public class ClaudeAiContentGenerator implements AiContentGenerator { requestBody.put("category", request.getCategory()); requestBody.put("contentType", request.getContentType()); requestBody.put("requirement", request.getRequirement()); - - //requestBody.put("tone_and_manner", request.getToneAndManner()); - // requestBody.put("emotion_intensity", request.getEmotionIntensity()); requestBody.put("target", request.getTarget()); - requestBody.put("event_name", request.getEventName()); requestBody.put("start_date", request.getStartDate()); requestBody.put("end_date", request.getEndDate()); - requestBody.put("images", request.getImages()); // Python AI 서비스 호출 @@ -63,8 +57,8 @@ public class ClaudeAiContentGenerator implements AiContentGenerator { .bodyValue(requestBody) .retrieve() .bodyToMono(Map.class) - .timeout(Duration.ofSeconds(60)) - .block(); + .timeout(Duration.ofSeconds(300)) + .block(Duration.ofMinutes(6)); String content = ""; @@ -76,10 +70,6 @@ public class ClaudeAiContentGenerator implements AiContentGenerator { return content; } return content; -// } catch (Exception e) { -// log.error("AI 서비스 호출 실패: {}", e.getMessage(), e); -// return generateFallbackContent(request.getTitle(), Platform.fromString(request.getPlatform())); -// } } /**