Skip to content

Commit

Permalink
Fix timer
Browse files Browse the repository at this point in the history
  • Loading branch information
hexiaofeng committed Jan 10, 2025
1 parent 10901d1 commit 559a210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private void pass(InboundInvocation<?> invocation, SystemLoad threshold, SystemL
* @param time the delay in milliseconds before the task is executed
*/
private void addTask(long time) {
timer.add(LOAD_LIMITER_TIMER, time, this::compute);
timer.delay(LOAD_LIMITER_TIMER, time, this::compute);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void removeClient(final RedisClient client) {
* @param client the Redis client to be recycled
*/
private void addTask(RedisClient client) {
timer.add("Recycle-RedisClient-" + client.getId(), 5000, () -> {
timer.delay("Recycle-RedisClient-" + client.getId(), 5000, () -> {
if (client.isExpired(10000)) {
client.shutdown();
} else {
Expand Down

0 comments on commit 559a210

Please sign in to comment.