Made JobQueueFederated no longer need "checkDelay" for delaying
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 11 Mar 2015 18:12:50 +0000 (11:12 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 11 Mar 2015 18:15:40 +0000 (11:15 -0700)
This reverts commit b9fd0f311c292424fd49d7bff550f67e94a62bc4.

Change-Id: Ibff28591c268689d593cb56a58e0b33c22292eba

includes/jobqueue/JobQueue.php
includes/jobqueue/JobQueueRedis.php

index 1a730d3..f4fe913 100644 (file)
@@ -44,9 +44,6 @@ abstract class JobQueue {
        /** @var int Maximum number of times to try a job */
        protected $maxTries;
 
-       /** @var bool Allow delayed jobs */
-       protected $checkDelay;
-
        /** @var BagOStuff */
        protected $dupCache;
        /** @var JobQueueAggregator */
@@ -73,10 +70,6 @@ abstract class JobQueue {
                if ( !in_array( $this->order, $this->supportedOrders() ) ) {
                        throw new MWException( __CLASS__ . " does not support '{$this->order}' order." );
                }
-               $this->checkDelay = !empty( $params['checkDelay'] );
-               if ( $this->checkDelay && !$this->supportsDelayedJobs() ) {
-                       throw new MWException( __CLASS__ . " does not support delayed jobs." );
-               }
                $this->dupCache = wfGetCache( CACHE_ANYTHING );
                $this->aggr = isset( $params['aggregator'] )
                        ? $params['aggregator']
@@ -103,10 +96,6 @@ abstract class JobQueue {
         *                  but not acknowledged as completed after this many seconds. Recycling
         *                  of jobs simple means re-inserting them into the queue. Jobs can be
         *                  attempted up to three times before being discarded.
-        *   - checkDelay : If supported, respect Job::getReleaseTimestamp() in the push functions.
-        *                  This lets delayed jobs wait in a staging area until a given timestamp is
-        *                  reached, at which point they will enter the queue. If this is not enabled
-        *                  or not supported, an exception will be thrown on delayed job insertion.
         *
         * Queue classes should throw an exception if they do not support the options given.
         *
@@ -148,14 +137,6 @@ abstract class JobQueue {
                return $this->order;
        }
 
-       /**
-        * @return bool Whether delayed jobs are enabled
-        * @since 1.22
-        */
-       final public function delayedJobsEnabled() {
-               return $this->checkDelay;
-       }
-
        /**
         * Get the allowed queue orders for configuration validation
         *
@@ -179,6 +160,14 @@ abstract class JobQueue {
                return false; // not implemented
        }
 
+       /**
+        * @return bool Whether delayed jobs are enabled
+        * @since 1.22
+        */
+       final public function delayedJobsEnabled() {
+               return $this->supportsDelayedJobs();
+       }
+
        /**
         * Quickly check if the queue has no available (unacquired, non-delayed) jobs.
         * Queue classes should use caching if they are any slower without memcached.
@@ -326,7 +315,7 @@ abstract class JobQueue {
                        if ( $job->getType() !== $this->type ) {
                                throw new MWException(
                                        "Got '{$job->getType()}' job; expected a '{$this->type}' job." );
-                       } elseif ( $job->getReleaseTimestamp() && !$this->checkDelay ) {
+                       } elseif ( $job->getReleaseTimestamp() && !$this->supportsDelayedJobs() ) {
                                throw new MWException(
                                        "Got delayed '{$job->getType()}' job; delays are not supported." );
                        }
index 243fec9..d9fe30b 100644 (file)
@@ -93,7 +93,6 @@ class JobQueueRedis extends JobQueue {
                                "Non-daemonized mode is no longer supported. Please install the " .
                                "mediawiki/services/jobrunner service and update \$wgJobTypeConf as needed." );
                }
-               $this->checkDelay = true; // always enabled
        }
 
        protected function supportedOrders() {