aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-11-02 14:55:11 +0300
committerGravatar Vitaly Takmazov2017-11-02 14:55:11 +0300
commit9ff710d38c569b89b8a3de42c474d2ed34cd4ba9 (patch)
tree70deb06c26c8ec45217cbcc8b1be78c7659c47a3 /juick-api/src/main/java/com
parent9a72efea7c78c7c16a80a411e001949949328b12 (diff)
api: only ping method is enough
Diffstat (limited to 'juick-api/src/main/java/com')
-rw-r--r--juick-api/src/main/java/com/juick/api/ApiServer.java13
1 files changed, 4 insertions, 9 deletions
diff --git a/juick-api/src/main/java/com/juick/api/ApiServer.java b/juick-api/src/main/java/com/juick/api/ApiServer.java
index 83e21e22..f4dd4d99 100644
--- a/juick-api/src/main/java/com/juick/api/ApiServer.java
+++ b/juick-api/src/main/java/com/juick/api/ApiServer.java
@@ -114,16 +114,11 @@ public class ApiServer implements ApplicationListener<DisconnectedEvent>, AutoCl
logger.warn("attachment error", e1);
}
}
- @Scheduled(fixedRate = 60000)
- public void reconnectWebsocket() {
- if (!webSocketConnectionManager.isRunning()) {
- logger.info("retrying...");
- webSocketConnectionManager.stop();
- webSocketConnectionManager.start();
- }
- }
+
@Override
public void onApplicationEvent(@Nonnull DisconnectedEvent event) {
- reconnectWebsocket();
+ logger.info("retrying...");
+ webSocketConnectionManager.stop();
+ webSocketConnectionManager.start();
}
}