Created
March 1, 2015 07:38
-
-
Save brianmed/27d566a4c841d06c21ea to your computer and use it in GitHub Desktop.
Minion snippet to retry a job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Sys::Hostname qw(hostname); | |
# ... | |
app->minion->add_task(query => sub { | |
my $job = shift; | |
my $hostname = shift; | |
unless ($hostname eq hostname) { | |
$job->retry; | |
return; | |
} | |
# ... | |
$job->finish({ status => "no_updates"}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment