From 666407c3abd19dc10da3a5945f6c619041a92524 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Wed, 21 Oct 2015 23:44:26 -0700 Subject: [PATCH] JobQueueRedis::doBatchPush(): report metrics even when failures occur The way the method is currently written, no stats are reported at all when failures occur. Change-Id: I627e8f6ce3a59098bc8949da7ed22f5c924177fc --- includes/jobqueue/JobQueueRedis.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/jobqueue/JobQueueRedis.php b/includes/jobqueue/JobQueueRedis.php index 419ed0e5af..1e957c2342 100644 --- a/includes/jobqueue/JobQueueRedis.php +++ b/includes/jobqueue/JobQueueRedis.php @@ -218,15 +218,15 @@ class JobQueueRedis extends JobQueue { $failed += count( $itemBatch ); } } - if ( $failed > 0 ) { - wfDebugLog( 'JobQueueRedis', "Could not insert {$failed} {$this->type} job(s)." ); - - throw new RedisException( "Could not insert {$failed} {$this->type} job(s)." ); - } JobQueue::incrStats( 'inserts', $this->type, count( $items ) ); JobQueue::incrStats( 'inserts_actual', $pushed ); JobQueue::incrStats( 'dupe_inserts', $this->type, count( $items ) - $failed - $pushed ); + if ( $failed > 0 ) { + $err = "Could not insert {$failed} {$this->type} job(s)."; + wfDebugLog( 'JobQueueRedis', $err ); + throw new RedisException( $err ); + } } catch ( RedisException $e ) { $this->throwRedisException( $conn, $e ); } -- 2.20.1