diff --git a/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java b/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java index dade8c3..424de11 100644 --- a/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java +++ b/src/main/java/com/zhanganzhi/chathub/receiver/KookReceiver.java @@ -132,4 +132,10 @@ public void onMessage(@NotNull WebSocket webSocket, @NotNull String text) { e.printStackTrace(); } } + + @Override + public void onFailure(@NotNull WebSocket webSocket, @NotNull Throwable t, Response response) { + logger.error("Kook websocket session disconnected! Reconnecting..."); + restart(); + } }