jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Made JobQueueFederated no longer need "checkDelay" for 
delaying"
......................................................................


Revert "Made JobQueueFederated no longer need "checkDelay" for delaying"

Breaks Cirrus and Wikibase

This reverts commit c8f96384aad312e52969b81dd8ce6b8d80c3857a.

Change-Id: I15278d52806bf30d6ea6c6b9eb8586160f65c42b
---
M includes/jobqueue/JobQueue.php
M includes/jobqueue/JobQueueRedis.php
2 files changed, 21 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php
index 0492954..1a730d3 100644
--- a/includes/jobqueue/JobQueue.php
+++ b/includes/jobqueue/JobQueue.php
@@ -44,6 +44,9 @@
        /** @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 */
@@ -69,6 +72,10 @@
                }
                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'] )
@@ -96,6 +103,10 @@
         *                  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.
         *
@@ -135,6 +146,14 @@
         */
        final public function getOrder() {
                return $this->order;
+       }
+
+       /**
+        * @return bool Whether delayed jobs are enabled
+        * @since 1.22
+        */
+       final public function delayedJobsEnabled() {
+               return $this->checkDelay;
        }
 
        /**
@@ -307,7 +326,7 @@
                        if ( $job->getType() !== $this->type ) {
                                throw new MWException(
                                        "Got '{$job->getType()}' job; expected 
a '{$this->type}' job." );
-                       } elseif ( $job->getReleaseTimestamp() && 
!$this->supportsDelayedJobs() ) {
+                       } elseif ( $job->getReleaseTimestamp() && 
!$this->checkDelay ) {
                                throw new MWException(
                                        "Got delayed '{$job->getType()}' job; 
delays are not supported." );
                        }
diff --git a/includes/jobqueue/JobQueueRedis.php 
b/includes/jobqueue/JobQueueRedis.php
index d9fe30b..243fec9 100644
--- a/includes/jobqueue/JobQueueRedis.php
+++ b/includes/jobqueue/JobQueueRedis.php
@@ -93,6 +93,7 @@
                                "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() {

-- 
To view, visit https://gerrit.wikimedia.org/r/195953
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I15278d52806bf30d6ea6c6b9eb8586160f65c42b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to