diff options
author | franck cuny <franck@lumberjaph.net> | 2010-06-28 10:58:48 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-06-28 10:58:48 +0200 |
commit | 232e5b67ed7a1d21e7c060135aae7e96ba72eb75 (patch) | |
tree | b0f84fd6ffc06574b4cfc9bea2432392e8c2ced8 /lib/presque/worker/Role | |
parent | fix queue_name (diff) | |
download | presque-worker-232e5b67ed7a1d21e7c060135aae7e96ba72eb75.tar.gz |
use try::tiny; send hash to mx::net::api
Diffstat (limited to 'lib/presque/worker/Role')
-rw-r--r-- | lib/presque/worker/Role/Job.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/presque/worker/Role/Job.pm b/lib/presque/worker/Role/Job.pm index c8a0e17..313116b 100644 --- a/lib/presque/worker/Role/Job.pm +++ b/lib/presque/worker/Role/Job.pm @@ -1,5 +1,6 @@ package presque::worker::Role::Job; +use Try::Tiny; use Moose::Role; has job_retries => (is => 'rw', isa => 'Int', default => 5); @@ -10,7 +11,7 @@ sub _job_failure { my $retries = ($job->{retries_left} || $self->job_retries) - 1; $job->{retries_left} = $retries; try { - $self->retry_job(queue_name => $self->queue_name, $job) if $retries > 0; + $self->retry_job(queue_name => $self->queue_name, %$job) if $retries > 0; } catch { # XXX |