Do not start explicit transaction rounds for RecentChangesUpdateJob
[lhc/web/wiklou.git] / includes / jobqueue / Job.php
index 8508861..f9c416f 100644 (file)
@@ -50,6 +50,12 @@ abstract class Job implements IJobSpecification {
        /** @var callable[] */
        protected $teardownCallbacks = [];
 
+       /** @var int Bitfield of JOB_* class constants */
+       protected $executionFlags = 0;
+
+       /** @var int Job must not be wrapped in the usual explicit LBFactory transaction round */
+       const JOB_NO_EXPLICIT_TRX_ROUND = 1;
+
        /**
         * Run the job
         * @return bool Success
@@ -108,6 +114,15 @@ abstract class Job implements IJobSpecification {
                }
        }
 
+       /**
+        * @param int $flag JOB_* class constant
+        * @return bool
+        * @since 1.31
+        */
+       public function hasExecutionFlag( $flag ) {
+               return ( $this->executionFlags && $flag ) === $flag;
+       }
+
        /**
         * Batch-insert a group of jobs into the queue.
         * This will be wrapped in a transaction with a forced commit.