Browse Source
Merge pull request #5822 from volodymyr-babak/fix-for-sessin-clean-up-and-pong
[3.3.3] Do not update ws lastActivity in case of general response
pull/5832/head
Andrew Shvayka
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
1 deletions
-
application/src/main/java/org/thingsboard/server/controller/plugin/TbWebSocketHandler.java
-
application/src/main/java/org/thingsboard/server/service/subscription/DefaultTbEntityDataSubscriptionService.java
|
|
@ -290,7 +290,6 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr |
|
|
log.trace("[{}] Failed to send msg", session.getId(), result.getException()); |
|
|
log.trace("[{}] Failed to send msg", session.getId(), result.getException()); |
|
|
closeSession(CloseStatus.SESSION_NOT_RELIABLE); |
|
|
closeSession(CloseStatus.SESSION_NOT_RELIABLE); |
|
|
} else { |
|
|
} else { |
|
|
lastActivityTime = System.currentTimeMillis(); |
|
|
|
|
|
String msg = msgQueue.poll(); |
|
|
String msg = msgQueue.poll(); |
|
|
if (msg != null) { |
|
|
if (msg != null) { |
|
|
sendMsgInternal(msg); |
|
|
sendMsgInternal(msg); |
|
|
|
|
|
@ -499,6 +499,12 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc |
|
|
if (ctx != null) { |
|
|
if (ctx != null) { |
|
|
ctx.cancelTasks(); |
|
|
ctx.cancelTasks(); |
|
|
ctx.clearSubscriptions(); |
|
|
ctx.clearSubscriptions(); |
|
|
|
|
|
if (ctx.getSessionId() != null) { |
|
|
|
|
|
Map<Integer, TbAbstractSubCtx> sessionSubs = subscriptionsBySessionId.get(ctx.getSessionId()); |
|
|
|
|
|
if (sessionSubs != null) { |
|
|
|
|
|
sessionSubs.remove(ctx.getCmdId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|