fix: 调高时长,更换一处日志

This commit is contained in:
liu.zixi
2025-12-04 19:58:58 +08:00
parent b07b620d14
commit 4015e461b2

View File

@@ -206,6 +206,7 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
EventSourceListener listener = new EventSourceListener() { EventSourceListener listener = new EventSourceListener() {
@Override @Override
public void onOpen(@NotNull EventSource eventSource, @NotNull Response response) { public void onOpen(@NotNull EventSource eventSource, @NotNull Response response) {
log.info("调用接口 [{}] 接口开始监听", request.url());
// 检查contentType // 检查contentType
String contentType = response.header("Content-Type"); String contentType = response.header("Content-Type");
if (contentType == null || !contentType.contains("text/event-stream")) { if (contentType == null || !contentType.contains("text/event-stream")) {
@@ -247,7 +248,6 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
eventSource.cancel(); eventSource.cancel();
return; return;
} }
log.info("调用接口 [{}] 接口开始监听", request.url());
// 将EventSource存储到Map中以便后续可以中断 // 将EventSource存储到Map中以便后续可以中断
conversationEventSourceMap.put(conversationId, eventSource); conversationEventSourceMap.put(conversationId, eventSource);
} }
@@ -365,7 +365,7 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
// 8. 执行HTTP请求 // 8. 执行HTTP请求
OkHttpClient client = new OkHttpClient.Builder() OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(60, TimeUnit.SECONDS) .connectTimeout(100, TimeUnit.SECONDS)
.writeTimeout(600, TimeUnit.SECONDS) .writeTimeout(600, TimeUnit.SECONDS)
.readTimeout(600, TimeUnit.SECONDS) .readTimeout(600, TimeUnit.SECONDS)
.callTimeout(600, TimeUnit.SECONDS) .callTimeout(600, TimeUnit.SECONDS)