Merge "Automatically deduplicate root jobs on insertion"
[lhc/web/wiklou.git] / includes / jobqueue / Job.php
index 78e1f71..f7ef8a9 100644 (file)
@@ -134,6 +134,16 @@ abstract class Job implements IJobSpecification {
                        : null;
        }
 
+       /**
+        * @return int|null UNIX timestamp of when the job was queued, or null
+        * @since 1.26
+        */
+       public function getQueuedTimestamp() {
+               return isset( $this->metadata['timestamp'] )
+                       ? wfTimestampOrNull( TS_UNIX, $this->metadata['timestamp'] )
+                       : null;
+       }
+
        /**
         * Whether the queue should reject insertion of this job if a duplicate exists
         *