Skip to content

Commit

Permalink
update RedisClientHub
Browse files Browse the repository at this point in the history
  • Loading branch information
nxttl-ucas committed Jun 25, 2021
1 parent 1d179c9 commit 8507f78
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,16 @@ public Boolean call() {
redisClient.getClientName(), delaySeconds);
redisClient.markClosing();
ExecutorUtils.newTimeout(timeout -> {
//double check
if (redisClient.isIdle()) {
logger.info("{} will close because connection is idle", redisClient.getClientName());
redisClient.stop(true);
} else {
checkIdleAndStop(redisClient);
try {
//double check
if (redisClient.isIdle()) {
logger.info("{} will close because connection is idle", redisClient.getClientName());
redisClient.stop(true);
} else {
checkIdleAndStop(redisClient);
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}, delaySeconds, TimeUnit.SECONDS);
return true;
Expand Down

0 comments on commit 8507f78

Please sign in to comment.