Commit 17977944 authored by Yusuke Iwaki's avatar Yusuke Iwaki

fix keepalive on connection loss.

parent a9bfc66e
...@@ -67,6 +67,9 @@ public class RocketChatService extends Service { ...@@ -67,6 +67,9 @@ public class RocketChatService extends Service {
.findAll(); .findAll();
for (ServerConfig config : targetConfigs) { for (ServerConfig config : targetConfigs) {
config.setConnectionError(null); config.setConnectionError(null);
if (config.isTokenVerified()) {
config.setTokenVerified(false);
}
} }
return null; return null;
}).onSuccessTask(task -> { }).onSuccessTask(task -> {
......
...@@ -155,6 +155,11 @@ public class RocketChatWebSocketThread extends HandlerThread { ...@@ -155,6 +155,11 @@ public class RocketChatWebSocketThread extends HandlerThread {
task.getResult().client.getOnCloseCallback().onSuccess(_task -> { task.getResult().client.getOnCloseCallback().onSuccess(_task -> {
quit(); quit();
return null; return null;
}).continueWith(_task -> {
if (_task.isFaulted()) {
ServerConfig.logConnectionError(serverConfigId, _task.getError());
}
return null;
}); });
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment