mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 09:26:47 +00:00
Attempt an orderly websocket close on displacement before a hard disconnect
This commit is contained in:
1 parent
bf1190696e
commit
08f0cf6d17
1 file changed
+7
-1
+7
-1
@@ -363,7 +363,13 @@ public class WebSocketConnection implements MessageAvailabilityListener, Displac
|
||||
public void handleDisplacement() {
|
||||
Metrics.counter(DISPLACEMENT_COUNTER_NAME, List.of(UserAgentTagUtil.getPlatformTag(client.getUserAgent()))).increment();
|
||||
|
||||
client.hardDisconnectQuietly();
|
||||
try {
|
||||
client.close(1000, "OK");
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Orderly close failed", e);
|
||||
|
||||
client.hardDisconnectQuietly();
|
||||
}
|
||||
}
|
||||
|
||||
private static class StoredMessageInfo {
|
||||
|
||||
Reference in new issue
Block a user