From 89ae8b1d49a1214f5e92c37d8e6ee3022eab27bd Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Fri, 24 Feb 2006 20:38:46 +0000 Subject: [PATCH] * live immediatebegin hack * remove ORDER BY for pop operation, InnoDB sorts by PK anyway, MyISAM would work as 'pool' rather than 'stack', submited to http://bugs.mysql.com/bug.php?id=17711 --- includes/JobQueue.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/JobQueue.php b/includes/JobQueue.php index b18a819185..82d2fcaa63 100644 --- a/includes/JobQueue.php +++ b/includes/JobQueue.php @@ -49,13 +49,14 @@ class Job { // Pop an item off the front of the queue // Method due to Domas, may not work on all DBMSes $dbw =& wfGetDB( DB_MASTER ); + $dbw->immediateBegin(); $jobTable = $dbw->tableName( 'job' ); $dbw->query( "DELETE FROM $jobTable WHERE " . '(job_cmd = @job_cmd := job_cmd) AND ' . '(job_namespace = @job_namespace := job_namespace) AND ' . '(job_title = @job_title := job_title) AND ' . '(job_params = @job_params := job_params) ' . - 'ORDER BY job_id LIMIT 1', $fname ); + 'LIMIT 1', $fname ); $affected = $dbw->affectedRows(); // Commit now before 100 other threads pile up behind us $dbw->immediateCommit(); -- 2.20.1