修复bug

This commit is contained in:
qaq
2025-06-26 15:33:01 +08:00
parent f940addacb
commit 5a11c37f90
4 changed files with 8 additions and 32 deletions
@@ -272,19 +272,6 @@ public class WebSocketServer extends TextWebSocketHandler {
public static GostDto send_msg(Long node_id, Object msg, String type) {
return send_msg(node_id, msg, type, 10); // 默认10秒超时
}
/**
* 发送消息到指定节点(支持自定义超时时间)
*
* @param node_id 节点ID
* @param msg 消息内容
* @param type 消息类型
* @param timeoutSeconds 超时时间(秒)
* @return 响应结果
*/
public static GostDto send_msg(Long node_id, Object msg, String type, int timeoutSeconds) {
WebSocketSession nodeSession = nodeSessions.get(node_id);
if (nodeSession == null) {
@@ -314,7 +301,7 @@ public class WebSocketServer extends TextWebSocketHandler {
data.put("data", msg);
data.put("requestId", requestId);
sendToUser(nodeSession, data.toJSONString());
GostDto result = future.get(timeoutSeconds, TimeUnit.SECONDS);
GostDto result = future.get(10, TimeUnit.SECONDS);
return result;
} catch (Exception e) {