ConnectionWatchdog should handle timer's IllegalStateException properly

pull/1025/head
Nikita 8 years ago
parent 90f1d528ca
commit 42d6df5752

@ -82,12 +82,16 @@ public class ConnectionWatchdog extends ChannelInboundHandlerAdapter {
return; return;
} }
try {
timer.newTimeout(new TimerTask() { timer.newTimeout(new TimerTask() {
@Override @Override
public void run(Timeout timeout) throws Exception { public void run(Timeout timeout) throws Exception {
tryReconnect(connection, Math.min(BACKOFF_CAP, attempts + 1)); tryReconnect(connection, Math.min(BACKOFF_CAP, attempts + 1));
} }
}, timeout, TimeUnit.MILLISECONDS); }, timeout, TimeUnit.MILLISECONDS);
} catch (IllegalStateException e) {
// skip
}
} }
private void tryReconnect(final RedisConnection connection, final int nextAttempt) { private void tryReconnect(final RedisConnection connection, final int nextAttempt) {

Loading…
Cancel
Save