Index: trunk/phase3/includes/LinksUpdate.php |
— | — | @@ -345,15 +345,22 @@ |
346 | 346 | $where = false; |
347 | 347 | } |
348 | 348 | } |
| 349 | + |
| 350 | + // Create and use a new loadBalancer object, to prevent "1205: Lock wait timeout exceeded;" |
| 351 | + $lb = wfGetLBFactory()->newMainLB(); |
| 352 | + $dbw = $lb->getConnection( DB_MASTER ); |
| 353 | + |
349 | 354 | if ( $where ) { |
350 | | - $this->mDb->delete( $table, $where, __METHOD__ ); |
| 355 | + $dbw->delete( $table, $where, __METHOD__ ); |
351 | 356 | } |
352 | 357 | if ( count( $insertions ) ) { |
353 | | - $this->mDb->insert( $table, $insertions, __METHOD__, 'IGNORE' ); |
| 358 | + $dbw->insert( $table, $insertions, __METHOD__, 'IGNORE' ); |
354 | 359 | } |
| 360 | + |
| 361 | + $lb->commitMasterChanges(); |
| 362 | + $lb->closeAll(); |
355 | 363 | } |
356 | 364 | |
357 | | - |
358 | 365 | /** |
359 | 366 | * Get an array of pagelinks insertions for passing to the DB |
360 | 367 | * Skips the titles specified by the 2-D array $existing |