From dbbb17e3c7981174b433743c3276b1d1cc5315b0 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 13 Nov 2012 23:00:09 -0800 Subject: [PATCH] [JobQueue] Added missing delete query. Change-Id: I8f900f5d7af3f42e348ac733cdf8deff37d4d055 --- includes/job/JobQueueDB.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php index 0ce42961c1d..cbb23915655 100644 --- a/includes/job/JobQueueDB.php +++ b/includes/job/JobQueueDB.php @@ -292,8 +292,9 @@ class JobQueueDB extends JobQueue { * @return integer Number of jobs recycled/deleted */ protected function recycleStaleJobs() { - $now = time(); - $dbw = $this->getMasterDB(); + $now = time(); + $dbw = $this->getMasterDB(); + $count = 0; // affected rows if ( $this->claimTTL > 0 ) { // re-try stale jobs... $claimCutoff = $dbw->timestamp( $now - $this->claimTTL ); @@ -311,6 +312,7 @@ class JobQueueDB extends JobQueue { "job_attempts < {$dbw->addQuotes( self::MAX_ATTEMPTS )}" ), __METHOD__ ); + $count += $dbw->affectedRows(); } // Just destroy stale jobs... @@ -323,8 +325,10 @@ class JobQueueDB extends JobQueue { if ( $this->claimTTL > 0 ) { // only prune jobs attempted too many times... $conds[] = "job_attempts >= {$dbw->addQuotes( self::MAX_ATTEMPTS )}"; } + $dbw->delete( 'job', $conds, __METHOD__ ); + $count += $dbw->affectedRows(); - return $dbw->affectedRows(); + return $count; } /** -- 2.11.4.GIT