From: Aaron Schulz Date: Wed, 14 Nov 2012 07:00:09 +0000 (-0800) Subject: [JobQueue] Added missing delete query. X-Git-Tag: 1.31.0-rc.0~21643 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=dbbb17e3c7981174b433743c3276b1d1cc5315b0;p=lhc%2Fweb%2Fwiklou.git [JobQueue] Added missing delete query. Change-Id: I8f900f5d7af3f42e348ac733cdf8deff37d4d055 --- diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php index 0ce42961c1..cbb2391565 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; } /**