From bd196ef1e868b17dc63483d26790808ac7a52c85 Mon Sep 17 00:00:00 2001 From: Xin Zheng Date: Thu, 11 Jan 2024 14:10:00 +0700 Subject: [PATCH] fixed retry timestamp --- src/main/java/org/swisspush/redisques/RedisQues.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/swisspush/redisques/RedisQues.java b/src/main/java/org/swisspush/redisques/RedisQues.java index 7cb8fa7..348963e 100644 --- a/src/main/java/org/swisspush/redisques/RedisQues.java +++ b/src/main/java/org/swisspush/redisques/RedisQues.java @@ -691,13 +691,17 @@ private void processMessageWithTimeout(final String queue, final String payload, boolean success; if (reply.succeeded()) { success = OK.equals(reply.result().body().getString(STATUS)); - dequeueStatistic.get(queue).lastDequeueSuccessTimestamp = System.currentTimeMillis(); - dequeueStatistic.get(queue).nextDequeueDueTimestamp = null; + if (success) { + dequeueStatistic.get(queue).lastDequeueSuccessTimestamp = System.currentTimeMillis(); + dequeueStatistic.get(queue).nextDequeueDueTimestamp = null; + } } else { log.info("RedisQues QUEUE_ERROR: Consumer failed {} queue: {}", uid, queue, new Exception(reply.cause())); success = Boolean.FALSE; } + + handler.handle(success); }); updateTimestamp(queue, null);