SiteStats::jobs fix when there is a single job
authorAntoine Musso <hashar@free.fr>
Mon, 29 May 2017 19:32:50 +0000 (21:32 +0200)
committerAntoine Musso <hashar@free.fr>
Mon, 29 May 2017 19:32:50 +0000 (21:32 +0200)
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

index 6ce1aed..86a4f63 100644 (file)
@@ -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;
        }