Skip to content

Instantly share code, notes, and snippets.

@brianmed
Created March 1, 2015 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianmed/27d566a4c841d06c21ea to your computer and use it in GitHub Desktop.
Save brianmed/27d566a4c841d06c21ea to your computer and use it in GitHub Desktop.
Minion snippet to retry a job
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