Merge "Update referenced PHP version in 'normal' README."
[lhc/web/wiklou.git] / includes / job / JobQueueFederated.php
index ed3c4f4..db5b686 100644 (file)
@@ -61,7 +61,7 @@ class JobQueueFederated extends JobQueue {
        protected $cache;
 
        const CACHE_TTL_SHORT = 30; // integer; seconds to cache info without re-validating
-       const CACHE_TTL_LONG  = 300; // integer; seconds to cache info that is kept up to date
+       const CACHE_TTL_LONG = 300; // integer; seconds to cache info that is kept up to date
 
        /**
         * @params include:
@@ -212,7 +212,7 @@ class JobQueueFederated extends JobQueue {
                $partitionRing = new HashRing( $partitionsTry );
                // Because jobs are spread across partitions, per-job de-duplication needs
                // to use a consistent hash to avoid allowing duplicate jobs per partition.
-               // When inserting a batch of de-duplicated jobs, QoS_Atomic is disregarded.
+               // When inserting a batch of de-duplicated jobs, QOS_ATOMIC is disregarded.
                $uJobsByPartition = array(); // (partition name => job list)
                foreach ( $jobs as $key => $job ) {
                        if ( $job->ignoreDuplicates() ) {
@@ -222,7 +222,7 @@ class JobQueueFederated extends JobQueue {
                        }
                }
                // Get the batches of jobs that are not de-duplicated
-               if ( $flags & self::QoS_Atomic ) {
+               if ( $flags & self::QOS_ATOMIC ) {
                        $nuJobBatches = array( $jobs ); // all or nothing
                } else {
                        // Split the jobs into batches and spread them out over servers if there
@@ -298,6 +298,12 @@ class JobQueueFederated extends JobQueue {
                return $this->partitionQueues[$job->metadata['QueuePartition']]->ack( $job );
        }
 
+       protected function doDelete() {
+               foreach ( $this->partitionQueues as $queue ) {
+                       $queue->doDelete();
+               }
+       }
+
        protected function doWaitForBackups() {
                foreach ( $this->partitionQueues as $queue ) {
                        $queue->waitForBackups();