Index: trunk/phase3/includes/job/JobQueue.php |
— | — | @@ -56,15 +56,18 @@ |
57 | 57 | |
58 | 58 | $dbw = wfGetDB( DB_MASTER ); |
59 | 59 | |
| 60 | + $dbw->begin(); |
| 61 | + |
60 | 62 | $row = $dbw->selectRow( |
61 | 63 | 'job', |
62 | 64 | '*', |
63 | 65 | array( 'job_cmd' => $type ), |
64 | 66 | __METHOD__, |
65 | | - array( 'LIMIT' => 1 ) |
| 67 | + array( 'LIMIT' => 1, 'FOR UPDATE' ) |
66 | 68 | ); |
67 | 69 | |
68 | 70 | if ( $row === false ) { |
| 71 | + $dbw->commit(); |
69 | 72 | wfProfileOut( __METHOD__ ); |
70 | 73 | return false; |
71 | 74 | } |