mediawiki.ui: Update mw-ui-input padding/line-height to match OOUI
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueSecondTestQueue.php
index a1935df..01f467f 100644 (file)
@@ -27,6 +27,11 @@ class JobQueueSecondTestQueue extends JobQueue {
         */
        private $debugQueue;
 
+       /**
+        * @var bool
+        */
+       private $onlyWriteToDebugQueue;
+
        protected function __construct( array $params ) {
                if ( !isset( $params['mainqueue'] ) ) {
                        throw new MWException( "mainqueue parameter must be provided to the debug queue" );
@@ -39,6 +44,7 @@ class JobQueueSecondTestQueue extends JobQueue {
                $conf = [ 'wiki' => $params['wiki'], 'type' => $params['type'] ];
                $this->mainQueue = JobQueue::factory( $params['mainqueue'] + $conf );
                $this->debugQueue = JobQueue::factory( $params['debugqueue'] + $conf );
+               $this->onlyWriteToDebugQueue = isset( $params['readonly'] ) ? $params['readonly'] : false;
 
                // We need to construct parent after creating the main and debug queue
                // because super constructor calls some methods we delegate to the main queue.
@@ -118,7 +124,9 @@ class JobQueueSecondTestQueue extends JobQueue {
         * @param int $flags
         */
        protected function doBatchPush( array $jobs, $flags ) {
-               $this->mainQueue->doBatchPush( $jobs, $flags );
+               if ( !$this->onlyWriteToDebugQueue ) {
+                       $this->mainQueue->doBatchPush( $jobs, $flags );
+               }
 
                try {
                        $this->debugQueue->doBatchPush( $jobs, $flags );
@@ -138,6 +146,7 @@ class JobQueueSecondTestQueue extends JobQueue {
        /**
         * @see JobQueue::ack()
         * @param Job $job
+        * @return Job|bool
         */
        protected function doAck( Job $job ) {
                return $this->mainQueue->doAck( $job );
@@ -172,6 +181,7 @@ class JobQueueSecondTestQueue extends JobQueue {
 
        /**
         * @see JobQueue::delete()
+        * @return bool
         * @throws MWException
         */
        protected function doDelete() {