Merge "Revert "Enforce stricter slave lag limits for bot API requests""
[lhc/web/wiklou.git] / includes / jobqueue / JobQueueRedis.php
index 002fe0d..1e957c2 100644 (file)
@@ -218,14 +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 );
                }