mw.ui: button: Update focus state
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueFederated.php
index fce30fb..246c06e 100644 (file)
@@ -72,7 +72,7 @@ class JobQueueFederated extends JobQueue {
         *                          have explicitly defined sections.
         *  - configByPartition   : Map of queue partition names to configuration arrays.
         *                          These configuration arrays are passed to JobQueue::factory().
-        *                          The options set here are overriden by those passed to this
+        *                          The options set here are overridden by those passed to this
         *                          the federated queue itself (e.g. 'order' and 'claimTTL').
         *  - partitionsNoPush    : List of partition names that can handle pop() but not push().
         *                          This can be used to migrate away from a certain partition.
@@ -160,7 +160,7 @@ class JobQueueFederated extends JobQueue {
                                $empty = $empty && $queue->doIsEmpty();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -204,7 +204,7 @@ class JobQueueFederated extends JobQueue {
                                $count += $queue->$method();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -277,11 +277,11 @@ class JobQueueFederated extends JobQueue {
                                $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
                        } catch ( JobQueueError $e ) {
                                $ok = false;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                        if ( $ok ) {
                                $key = $this->getCacheKey( 'empty' );
-                               $this->cache->set( $key, 'false', JobQueueDB::CACHE_TTL_LONG );
+                               $this->cache->set( $key, 'false', self::CACHE_TTL_LONG );
                        } else {
                                if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) { // blacklist
                                        throw new JobQueueError( "Could not insert job(s), no partitions available." );
@@ -299,11 +299,11 @@ class JobQueueFederated extends JobQueue {
                                $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
                        } catch ( JobQueueError $e ) {
                                $ok = false;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                        if ( $ok ) {
                                $key = $this->getCacheKey( 'empty' );
-                               $this->cache->set( $key, 'false', JobQueueDB::CACHE_TTL_LONG );
+                               $this->cache->set( $key, 'false', self::CACHE_TTL_LONG );
                        } else {
                                if ( !$partitionRing->ejectFromLiveRing( $partition, 5 ) ) { // blacklist
                                        throw new JobQueueError( "Could not insert job(s), no partitions available." );
@@ -331,7 +331,7 @@ class JobQueueFederated extends JobQueue {
                                $job = $queue->pop();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                                $job = false;
                        }
                        if ( $job ) {
@@ -345,7 +345,7 @@ class JobQueueFederated extends JobQueue {
                $this->throwErrorIfAllPartitionsDown( $failed );
 
                $key = $this->getCacheKey( 'empty' );
-               $this->cache->set( $key, 'true', JobQueueDB::CACHE_TTL_LONG );
+               $this->cache->set( $key, 'true', self::CACHE_TTL_LONG );
 
                return false;
        }
@@ -398,7 +398,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->doDelete();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -413,7 +413,7 @@ class JobQueueFederated extends JobQueue {
                                $queue->waitForBackups();
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -495,7 +495,7 @@ class JobQueueFederated extends JobQueue {
                                }
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -519,7 +519,7 @@ class JobQueueFederated extends JobQueue {
                                }
                        } catch ( JobQueueError $e ) {
                                ++$failed;
-                               MWExceptionHandler::logException( $e );
+                               $this->logException( $e );
                        }
                }
                $this->throwErrorIfAllPartitionsDown( $failed );
@@ -527,6 +527,10 @@ class JobQueueFederated extends JobQueue {
                return $result;
        }
 
+       protected function logException( Exception $e ) {
+               wfDebugLog( 'JobQueueFederated', $e->getMessage() . "\n" . $e->getTraceAsString() );
+       }
+
        /**
         * Throw an error if no partitions available
         *