From 559a21023038b042118069d01c7f003f80f95a34 Mon Sep 17 00:00:00 2001 From: hexiaofeng Date: Fri, 10 Jan 2025 11:52:06 +0800 Subject: [PATCH] Fix timer --- .../agent/governance/invoke/filter/inbound/LoadLimitFilter.java | 2 +- .../ratelimit/redisson/client/RedisClientManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/invoke/filter/inbound/LoadLimitFilter.java b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/invoke/filter/inbound/LoadLimitFilter.java index cedd4af6..95185279 100644 --- a/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/invoke/filter/inbound/LoadLimitFilter.java +++ b/joylive-core/joylive-governance-api/src/main/java/com/jd/live/agent/governance/invoke/filter/inbound/LoadLimitFilter.java @@ -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); } /** diff --git a/joylive-implement/joylive-flowcontrol/joylive-flowcontrol-redisson/src/main/java/com/jd/live/agent/implement/flowcontrol/ratelimit/redisson/client/RedisClientManager.java b/joylive-implement/joylive-flowcontrol/joylive-flowcontrol-redisson/src/main/java/com/jd/live/agent/implement/flowcontrol/ratelimit/redisson/client/RedisClientManager.java index 90f4f235..46c04292 100644 --- a/joylive-implement/joylive-flowcontrol/joylive-flowcontrol-redisson/src/main/java/com/jd/live/agent/implement/flowcontrol/ratelimit/redisson/client/RedisClientManager.java +++ b/joylive-implement/joylive-flowcontrol/joylive-flowcontrol-redisson/src/main/java/com/jd/live/agent/implement/flowcontrol/ratelimit/redisson/client/RedisClientManager.java @@ -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 {