From: Aaron Schulz Date: Wed, 20 Feb 2013 00:56:47 +0000 (-0800) Subject: [JobQueue] Allow certain job types to always opt out of retries. X-Git-Tag: 1.31.0-rc.0~20641 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=f8988e0894da8e0cbf809dad5d8bd50b24d9d4ea;p=lhc%2Fweb%2Fwiklou.git [JobQueue] Allow certain job types to always opt out of retries. Change-Id: I4cdd43b0b248700e199947e99d2df32b91e23ef7 --- diff --git a/includes/job/Job.php b/includes/job/Job.php index 24e9093622..9ec58c9d1b 100644 --- a/includes/job/Job.php +++ b/includes/job/Job.php @@ -177,12 +177,19 @@ abstract class Job { } /** - * @return bool + * @return bool Whether only one of each identical set of jobs should be run */ public function ignoreDuplicates() { return $this->removeDuplicates; } + /** + * @return bool Whether this job can be retried on failure by job runners + */ + public function allowRetries() { + return true; + } + /** * Subclasses may need to override this to make duplication detection work * diff --git a/maintenance/runJobs.php b/maintenance/runJobs.php index f64b5e82f7..ff096834f2 100644 --- a/maintenance/runJobs.php +++ b/maintenance/runJobs.php @@ -96,7 +96,7 @@ class RunJobs extends Maintenance { wfWarn( $job->getType() . " job failed to return a boolean." ); $status = true; // sanity } - if ( $status ) { + if ( $status || !$job->allowRetries() ) { $group->ack( $job ); // done }