Do not update ws lastActivity in case of general response - only on pong response. Clean up properly subscription map in case canceling subsription
This commit is contained in:
parent
fe38da0b34
commit
7589330406
@ -290,7 +290,6 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr
|
||||
log.trace("[{}] Failed to send msg", session.getId(), result.getException());
|
||||
closeSession(CloseStatus.SESSION_NOT_RELIABLE);
|
||||
} else {
|
||||
lastActivityTime = System.currentTimeMillis();
|
||||
String msg = msgQueue.poll();
|
||||
if (msg != null) {
|
||||
sendMsgInternal(msg);
|
||||
|
||||
@ -499,6 +499,12 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc
|
||||
if (ctx != null) {
|
||||
ctx.cancelTasks();
|
||||
ctx.clearSubscriptions();
|
||||
if (ctx.getSessionId() != null) {
|
||||
Map<Integer, TbAbstractSubCtx> sessionSubs = subscriptionsBySessionId.get(ctx.getSessionId());
|
||||
if (sessionSubs != null) {
|
||||
sessionSubs.remove(ctx.getCmdId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user