Browse Source
Merge pull request #10856 from YevhenBondarenko/fix/application-stop
clear all WS sessionsMap when stopping the application
pull/10876/head
Andrew Shvayka
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
0 deletions
-
application/src/main/java/org/thingsboard/server/controller/plugin/TbWebSocketHandler.java
|
|
|
@ -18,6 +18,7 @@ package org.thingsboard.server.controller.plugin; |
|
|
|
import com.github.benmanes.caffeine.cache.Cache; |
|
|
|
import com.github.benmanes.caffeine.cache.Caffeine; |
|
|
|
import com.github.benmanes.caffeine.cache.RemovalCause; |
|
|
|
import jakarta.annotation.PreDestroy; |
|
|
|
import jakarta.websocket.RemoteEndpoint; |
|
|
|
import jakarta.websocket.SendHandler; |
|
|
|
import jakarta.websocket.SendResult; |
|
|
|
@ -134,6 +135,11 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements WebSocke |
|
|
|
.build(); |
|
|
|
} |
|
|
|
|
|
|
|
@PreDestroy |
|
|
|
private void stop() { |
|
|
|
internalSessionMap.clear(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void handleTextMessage(WebSocketSession session, TextMessage message) { |
|
|
|
try { |
|
|
|
|