From e46bfdd4d73fc5bf0343d6658dfbd8acafefa0e1 Mon Sep 17 00:00:00 2001 From: Florian Langenhahn Date: Wed, 6 Jun 2018 11:40:45 +0200 Subject: [PATCH] fix case where we missed pushing a JobFailure we missed pushing the JobFailure in the case when there is a fail queue item limit and the current number of failed items is 0 the fix is to call rpush in this case as well --- src/main/java/net/greghaines/jesque/worker/WorkerImpl.java | 2 ++ src/main/java/net/greghaines/jesque/worker/WorkerPoolImpl.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java b/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java index 8786c5a0..db46ed72 100644 --- a/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java +++ b/src/main/java/net/greghaines/jesque/worker/WorkerImpl.java @@ -691,6 +691,8 @@ protected void failure(final Throwable thrwbl, final Job job, final String curQu tx.ltrim(failQueueKey, 1, -1); tx.rpush(failQueueKey, failMsg(thrwbl, curQueue, job)); tx.exec(); + } else { + this.jedis.rpush(failQueueKey, failMsg(thrwbl, curQueue, job)); } } else { this.jedis.rpush(failQueueKey, failMsg(thrwbl, curQueue, job)); diff --git a/src/main/java/net/greghaines/jesque/worker/WorkerPoolImpl.java b/src/main/java/net/greghaines/jesque/worker/WorkerPoolImpl.java index cd01d598..4860b47e 100644 --- a/src/main/java/net/greghaines/jesque/worker/WorkerPoolImpl.java +++ b/src/main/java/net/greghaines/jesque/worker/WorkerPoolImpl.java @@ -750,6 +750,8 @@ public Void doWork(final Jedis jedis) throws IOException { tx.ltrim(failQueueKey, 1, -1); tx.rpush(failQueueKey, failMsg(thrwbl, curQueue, job)); tx.exec(); + } else { + jedis.rpush(failQueueKey, failMsg(thrwbl, curQueue, job)); } } else { jedis.rpush(failQueueKey, failMsg(thrwbl, curQueue, job));