From: Ori Livneh Date: Thu, 22 Oct 2015 06:44:26 +0000 (-0700) Subject: JobQueueRedis::doBatchPush(): report metrics even when failures occur X-Git-Tag: 1.31.0-rc.0~9297 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=666407c3abd19dc10da3a5945f6c619041a92524;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); }