Skip to content

Commit

Permalink
fix: πŸ› automatically reconnect kook websocket when disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Dec 21, 2022
1 parent d84ed0a commit 5a53061
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 5a53061

Please sign in to comment.