Merge "Added some sanity warnings to TransactionProfiler"
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueRedis.php
index f5a266e..6739a84 100644 (file)
@@ -71,12 +71,6 @@ class JobQueueRedis extends JobQueue {
        /** @var string Key to prefix the queue keys with (used for testing) */
        protected $key;
 
-       /**
-        * @var null|int maximum seconds between execution of periodic tasks.  Used to speed up
-        * testing but should otherwise be left unset.
-        */
-       protected $maximumPeriodicTaskSeconds;
-
        /**
         * @params include:
         *   - redisConfig : An array of parameters to RedisConnectionPool::__construct().
@@ -85,10 +79,6 @@ class JobQueueRedis extends JobQueue {
         *                   If a hostname is specified but no port, the standard port number
         *                   6379 will be used. Required.
         *   - compression : The type of compression to use; one of (none,gzip).
-        *   - maximumPeriodicTaskSeconds : Maximum seconds between check periodic tasks.  Set to
-        *                   force faster execution of periodic tasks for inegration tests that
-        *                   rely on checkDelay.  Without this the integration tests are very very
-        *                   slow.  This really shouldn't be set in production.
         * @param array $params
         */
        public function __construct( array $params ) {
@@ -97,8 +87,6 @@ class JobQueueRedis extends JobQueue {
                $this->server = $params['redisServer'];
                $this->compression = isset( $params['compression'] ) ? $params['compression'] : 'none';
                $this->redisPool = RedisConnectionPool::singleton( $params['redisConfig'] );
-               $this->maximumPeriodicTaskSeconds = isset( $params['maximumPeriodicTaskSeconds'] ) ?
-                       $params['maximumPeriodicTaskSeconds'] : null;
        }
 
        protected function supportedOrders() {
@@ -194,8 +182,8 @@ class JobQueueRedis extends JobQueue {
        /**
         * @see JobQueue::doBatchPush()
         * @param array $jobs
-        * @param array $flags
-        * @return bool
+        * @param int $flags
+        * @return void
         * @throws JobQueueError
         */
        protected function doBatchPush( array $jobs, $flags ) {
@@ -211,7 +199,7 @@ class JobQueueRedis extends JobQueue {
                }
 
                if ( !count( $items ) ) {
-                       return true; // nothing to do
+                       return; // nothing to do
                }
 
                $conn = $this->getConnection();
@@ -235,7 +223,7 @@ class JobQueueRedis extends JobQueue {
                        if ( $failed > 0 ) {
                                wfDebugLog( 'JobQueueRedis', "Could not insert {$failed} {$this->type} job(s)." );
 
-                               return false;
+                               throw new RedisException( "Could not insert {$failed} {$this->type} job(s)." );
                        }
                        JobQueue::incrStats( 'job-insert', $this->type, count( $items ), $this->wiki );
                        JobQueue::incrStats( 'job-insert-duplicate', $this->type,
@@ -243,8 +231,6 @@ class JobQueueRedis extends JobQueue {
                } catch ( RedisException $e ) {
                        $this->throwRedisException( $conn, $e );
                }
-
-               return true;
        }
 
        /**
@@ -738,10 +724,7 @@ LUA;
                }
                $period = min( $periods );
                $period = max( $period, 30 ); // sanity
-               // Support override for faster testing
-               if ( $this->maximumPeriodicTaskSeconds !== null ) {
-                       $period = min( $period, $this->maximumPeriodicTaskSeconds );
-               }
+
                return array(
                        'recyclePruneAndUndelayJobs' => array(
                                'callback' => array( $this, 'recyclePruneAndUndelayJobs' ),