From a0055ae2d91074629350148e47482807deed13f5 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Sun, 25 Mar 2007 20:09:21 +0000 Subject: [PATCH] oops --- includes/JobQueue.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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 -- 2.20.1