Merge "[JobQueue] Added per-type stat counter calls for better graphs."
[lhc/web/wiklou.git] / includes / job / JobQueueRedis.php
index 3483f78..f17c295 100644 (file)
@@ -468,13 +468,10 @@ LUA;
         * @return bool
         */
        protected function doIsRootJobOldDuplicate( Job $job ) {
-               $params = $job->getParams();
-               if ( !isset( $params['rootJobSignature'] ) ) {
+               if ( !$job->hasRootJobParams() ) {
                        return false; // job has no de-deplication info
-               } elseif ( !isset( $params['rootJobTimestamp'] ) ) {
-                       wfDebugLog( 'JobQueueRedis', "Cannot check root job; missing 'rootJobTimestamp'." );
-                       return false;
                }
+               $params = $job->getRootJobParams();
 
                $conn = $this->getConnection();
                try {
@@ -494,9 +491,6 @@ LUA;
         */
        public function getAllQueuedJobs() {
                $conn = $this->getConnection();
-               if ( !$conn ) {
-                       throw new MWException( "Unable to connect to redis server." );
-               }
                try {
                        $that = $this;
                        return new MappedIterator(
@@ -516,9 +510,6 @@ LUA;
         */
        public function getAllDelayedJobs() {
                $conn = $this->getConnection();
-               if ( !$conn ) {
-                       throw new MWException( "Unable to connect to redis server." );
-               }
                try {
                        $that = $this;
                        return new MappedIterator( // delayed jobs