Resque::Failures - Class for managing Resque failures
version 0.23
Accessor to the Resque object.
Name of a class consuming the role 'Resque::Failure'. By default: Resque::Failure::Redis
create() a failure on the failure_class() and save() it.
Create a new failure on the failure_class() backend.
How many failures was in all the resque system.
Return a range of failures in the same way Resque::peek() does for jobs.
Remove all failures.
Requeue by index number.
Failure will be updated to note retried date.
Remove failure by index number in failures queue.
Please note that, when you remove some index, all sucesive ones will move left, so index will decrese one. If you want to remove several ones start removing from the rightmost one.
Remove and optionally requeue all or matching failed jobs. Errors that happen after this method is fired will remind untouched.
Filters, if present, are useful to select failed jobs and should be regexes or strings that will be matched against any of the following failed job field:
queue: the queue where job had failed class: the job class error: the error string args: a JSON representation of the job arguments
By default, all matching jobs will be deleted but the ones that doesn't match will be placed back at the end of the failed jobs.
The behavior can be modified with the following options:
requeue: requeue matching jobs after being removed. requeue_to: Requeued jobs will be placed on this queue instead of the original one. This option implies requeue.
Example
# Remove and requeue all failed jobs from queue 'test_queue' of class My::Job::Class $resque->failures->mass_remove( queue => 'test_queue', class => qr/^My::Job::Class$/, requeue => 1 );
Diego Kuperman <diego@freekeylabs.com>
This software is copyright (c) 2015 by Diego Kuperman.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Resque, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Resque
CPAN shell
perl -MCPAN -e shell install Resque
For more information on module installation, please visit the detailed CPAN module installation guide.