Обновить Telegram-бота, документацию и связанные доработки

This commit is contained in:
AidarKC
2026-06-06 13:45:02 +04:00
parent ce5c348023
commit c5ec32f87a
16 changed files with 772 additions and 56 deletions
@@ -9,6 +9,7 @@ import server.logic.ws_protocol.JSON.ActiveConnectionsRegistry;
import server.logic.ws_protocol.JSON.ConnectionContext;
import server.logic.ws_protocol.JSON.JsonInboundProcessor;
import java.nio.channels.ClosedChannelException;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicLong;
@@ -131,9 +132,19 @@ public class BlockchainWsEndpoint {
@OnWebSocketError
public void onError(Throwable cause) {
if (isNormalClosedChannel(cause)) {
log.info("WS channel already closed during normal shutdown: {}", cause.toString());
return;
}
log.error("WS error", cause);
}
private boolean isNormalClosedChannel(Throwable cause) {
if (cause == null) return false;
if (cause instanceof ClosedChannelException) return true;
return String.valueOf(cause).contains("ClosedChannelException");
}
private void trySendJsonError() {
if (session != null && session.isOpen()) {
String resp = "{\"op\":null,\"requestId\":null,\"status\":500,"
@@ -152,4 +163,4 @@ public class BlockchainWsEndpoint {
});
}
}
}
}