Use max() for job count for sanity
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 10 Oct 2013 21:56:11 +0000 (14:56 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 10 Oct 2013 21:56:11 +0000 (14:56 -0700)
Change-Id: If5979ccbede2dd70fcd26b7caae82419ddffe542

maintenance/showJobs.php

index 78c2e48..afd7c74 100644 (file)
@@ -59,7 +59,7 @@ class ShowJobs extends Maintenance {
                                $pending = $queue->getSize();
                                $claimed = $queue->getAcquiredCount();
                                $abandoned = $queue->getAbandonedCount();
-                               $active = $claimed - $abandoned;
+                               $active = max( 0, $claimed - $abandoned );
                                if ( ( $pending + $claimed ) > 0 ) {
                                        $this->output(
                                                "{$type}: $pending queued; " .