From e3f7dde410e0ac328190042af231e3fa13285e7d Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 29 May 2017 21:32:50 +0200 Subject: [PATCH] SiteStats::jobs fix when there is a single job wfSpecialStatistics() used a database to store the jobs. When estimating the number of row in the `job` table, even when there is no row MySQL would still do a single row read. Hence it erroneously returned 1. That got fixed in 7cd0b2e0b (T12228) with a hack. Nowadays, the functionality has been moved to SiteStats which is backed up by a JobQueueGroup. It now returns the exact number of jobs and the hack is no more needed. We failed to remove it when porting it to the JobQueue system. Change-Id: I6ef55b3dcff3e47a92e2eeeddcbae078654f815a --- includes/SiteStats.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 6ce1aed814..86a4f63aa4 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -222,13 +222,6 @@ class SiteStats { } catch ( JobQueueError $e ) { self::$jobs = 0; } - /** - * Zero rows still do single row read for row that doesn't exist, - * but people are annoyed by that - */ - if ( self::$jobs == 1 ) { - self::$jobs = 0; - } } return self::$jobs; } -- 2.20.1