diff options
Diffstat (limited to 'Bugzilla/Job/Mailer.pm')
-rw-r--r-- | Bugzilla/Job/Mailer.pm | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/Bugzilla/Job/Mailer.pm b/Bugzilla/Job/Mailer.pm index cd1c23445..544d86107 100644 --- a/Bugzilla/Job/Mailer.pm +++ b/Bugzilla/Job/Mailer.pm @@ -16,31 +16,33 @@ BEGIN { eval "use parent qw(TheSchwartz::Worker)"; } # The longest we expect a job to possibly take, in seconds. use constant grab_for => 300; + # We don't want email to fail permanently very easily. Retry for 30 days. use constant max_retries => 725; # The first few retries happen quickly, but after that we wait an hour for # each retry. sub retry_delay { - my ($class, $num_retries) = @_; - if ($num_retries < 5) { - return (10, 30, 60, 300, 600)[$num_retries]; - } - # One hour - return 60*60; + my ($class, $num_retries) = @_; + if ($num_retries < 5) { + return (10, 30, 60, 300, 600)[$num_retries]; + } + + # One hour + return 60 * 60; } sub work { - my ($class, $job) = @_; - my $msg = $job->arg->{msg}; - my $success = eval { MessageToMTA($msg, 1); 1; }; - if (!$success) { - $job->failed($@); - undef $@; - } - else { - $job->completed; - } + my ($class, $job) = @_; + my $msg = $job->arg->{msg}; + my $success = eval { MessageToMTA($msg, 1); 1; }; + if (!$success) { + $job->failed($@); + undef $@; + } + else { + $job->completed; + } } 1; |