Skip to content

Commit a240bcb

Browse files
martinbuttMartin Butt
andauthored
Fix issue with PID entries in Redis not being deleted for failed jobs (#74)
* Fix issue with PID entries in Redis not being deleted for failed jobs * Code style fix --------- Co-authored-by: Martin Butt <[email protected]>
1 parent aa523db commit a240bcb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/JobHandler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Resque;
44

55
use InvalidArgumentException;
6+
use Resque\Job\PID;
67
use Resque\Job\Status;
78
use Resque\Exceptions\DoNotPerformException;
89
use Resque\Job\FactoryInterface;
@@ -253,6 +254,11 @@ public function fail($exception)
253254
$this->queue
254255
);
255256
}
257+
258+
if (!empty($this->payload['id'])) {
259+
PID::del($this->payload['id']);
260+
}
261+
256262
Stat::incr('failed');
257263
Stat::incr('failed:' . $this->worker);
258264
}

0 commit comments

Comments
 (0)