From de43cf39e1b1df8d35f6407d2722c93417294bd8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 3 Apr 2013 22:19:35 -0700 Subject: [PATCH] [JobQueue] Simplified a bit of code in JobQueueRedis. Change-Id: Ia0329a9721b126a3573cfee0d67c9a54c911196f --- includes/job/JobQueueRedis.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/includes/job/JobQueueRedis.php b/includes/job/JobQueueRedis.php index 6947f73134..d30e20e85f 100644 --- a/includes/job/JobQueueRedis.php +++ b/includes/job/JobQueueRedis.php @@ -467,13 +467,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 { @@ -493,9 +490,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( @@ -515,9 +509,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 -- 2.20.1