fix: 服务繁忙的错误处理修正

This commit is contained in:
liu.zixi
2025-12-02 09:32:14 +08:00
parent 38c2784f51
commit dd0760a32b

View File

@@ -103,7 +103,6 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
private final Map<String, EventSource> conversationEventSourceMap = new ConcurrentHashMap<>(); private final Map<String, EventSource> conversationEventSourceMap = new ConcurrentHashMap<>();
@Override @Override
@Transactional
public SseEmitter chat(CaseAiChatDto caseAiChatDto, CurrentUser currentUser) { public SseEmitter chat(CaseAiChatDto caseAiChatDto, CurrentUser currentUser) {
// 创建SSE响应器 // 创建SSE响应器
SseEmitter sseEmitter = new SseEmitter(); SseEmitter sseEmitter = new SseEmitter();
@@ -746,8 +745,8 @@ public class CaseAiChatServiceImpl implements ICaseAiChatService {
jsonData.put("content", message); jsonData.put("content", message);
JSONObject finishData = new JSONObject(); JSONObject finishData = new JSONObject();
jsonData.put("status", 4); finishData.put("status", 4);
jsonData.put("content", ""); finishData.put("content", "");
try { try {
sseEmitter.send(conversationData.toJSONString()); sseEmitter.send(conversationData.toJSONString());
sseEmitter.send(jsonData.toJSONString()); sseEmitter.send(jsonData.toJSONString());