1. rent-agent-java 添加订单调试日志和可以删除本地订单记录 2. 心跳消息不用这么频繁,接收订单即使一点即可。

This commit is contained in:
lu7213 committed 2026-10-31 06:53:16 -04:00
1 parent baffaefc67
commit 13665668ac
2 files changed
+3 -1

No files matched your search

@@ -309,7 +309,8 @@ public class RentalSocket extends TextWebSocketHandler {
c.socket.close(CloseStatus.POLICY_VIOLATION); c.socket.close(CloseStatus.POLICY_VIOLATION);
continue; continue;
} }
if (c.ping == null) { // 快速扫描订单不等于快速发心跳;距离最近PONG至少15秒才主动探活。
if (c.ping == null && System.currentTimeMillis() - c.pong >= 15000) {
send(c, "PING", map()); send(c, "PING", map());
} }
if (!c.ready) { if (!c.ready) {
@@ -1307,6 +1307,7 @@ public class RentalBusinessTest {
continue; // 首个CHALLENGE不是签名业务帧。 continue; // 首个CHALLENGE不是签名业务帧。
} }
Map<String, Object> frame = json.readValue(text(envelope, "body"), Map.class); Map<String, Object> frame = json.readValue(text(envelope, "body"), Map.class);
assertFalse("快速推送扫描不应立即发送额外心跳", "PING".equals(text(frame, "type")));
if ("TASK_PUSH".equals(text(frame, "type"))) { if ("TASK_PUSH".equals(text(frame, "type"))) {
taskFrameFound = true; taskFrameFound = true;
} }