Open arunp27 opened 9 years ago
onFailure
event.{$prefix}:failed
- you can pop them from there and push them (back) onto whatever queue you like using the normal methods.@danhunsaker I am using the php-resque in a production app and php-resque heavily used on all 3rd party web service api calls. Yesterday I noticed some failed jobs by running the below code
//https://github.com/chrisboulton/php-resque/issues/171
$list = $redis->lrange('failed', 0, -1);
now am trying to requeue the failed jobs by following the instruction above and it seems to be working fine. but only the problem is, I cannot remove the elements from failed list.
foreach($list as $row) {
$row = json_decode($row);
$job = $row->payload;
$queue = $row->queue;
Resque::enqueue($queue, $job->class, $job->args);
}
I tried the php $redis->lTrim('failed');
inside the loop but it does not seems to be working :( any help greatly appreciated...
and also it would be great to have a feature for requeue a failed job
finally found the solution:
$redis->lpop('failed'); //removes and returns the first element
Hi, How can we know if a job is failed.. if the job is failed how to push into the queue using php script. and i've one more question how to restart workers programmatically.