r41621 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41620‎ | r41621 | r41622 >
Date:22:23, 3 October 2008
Author:brion
Status:old
Tags:
Comment:
add a damn deadlock loop on this thing
Modified paths:
  • /trunk/phase3/maintenance/updateRestrictions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updateRestrictions.php
@@ -66,7 +66,12 @@
6767 # We use insert() and not replace() as Article.php replaces
6868 # page_restrictions with '' when protected in the restrictions table
6969 if ( count( $batch ) ) {
70 - $db->insert( 'page_restrictions', $batch, __FUNCTION__, array( 'IGNORE' ) );
 70+ $ok = $db->deadlockLoop(
 71+ array( $db, 'insert' ),
 72+ 'page_restrictions', $batch, __FUNCTION__, array( 'IGNORE' ) );
 73+ if( !$ok ) {
 74+ throw new MWException( "Deadlock loop failed wtf :(" );
 75+ }
7176 }
7277 $blockStart += BATCH_SIZE - 1;
7378 $blockEnd += BATCH_SIZE - 1;

Status & tagging log