From: Domas Mituzas Date: Sun, 25 Mar 2007 20:09:21 +0000 (+0000) Subject: oops X-Git-Tag: 1.31.0-rc.0~53618 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=a0055ae2d91074629350148e47482807deed13f5;p=lhc%2Fweb%2Fwiklou.git oops --- diff --git a/includes/JobQueue.php b/includes/JobQueue.php index f291c07fef..54af5e73a7 100644 --- a/includes/JobQueue.php +++ b/includes/JobQueue.php @@ -43,22 +43,20 @@ abstract class Job { $row = $dbr->selectRow( 'job', '*', "job_id >= ${offset}", __METHOD__, array( 'ORDER BY' => 'job_id', 'LIMIT' => 1 )); - + // Refetching without offset is needed as some of job IDs could have had delayed commits // and have lower IDs than jobs already executed, blame concurrency :) - - if ( $row === false && $offset != 0 ) { - $offset=0; - $row = $dbr->selectRow( 'job', '*', '', __METHOD__, - array( 'ORDER BY' => 'job_id', 'LIMIT' => 1 )); + // + if ( $row === false) { + if ($offset!=0) + $row = $dbr->selectRow( 'job', '*', '', __METHOD__, + array( 'ORDER BY' => 'job_id', 'LIMIT' => 1 )); if ($row === false ) { wfProfileOut( __METHOD__ ); return false; } - } - - /* Still avoid scanning purged rows */ + } $offset = $row->job_id; // Try to delete it from the master