From: Brion Vibber Date: Fri, 3 Oct 2008 22:23:03 +0000 (+0000) Subject: add a damn deadlock loop on this thing X-Git-Tag: 1.31.0-rc.0~44942 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/One?a=commitdiff_plain;h=8b96893986589e7fd2b4ce18800bb520ee58d403;p=lhc%2Fweb%2Fwiklou.git add a damn deadlock loop on this thing --- diff --git a/maintenance/updateRestrictions.php b/maintenance/updateRestrictions.php index fd4c2712ba..7041e5938f 100644 --- a/maintenance/updateRestrictions.php +++ b/maintenance/updateRestrictions.php @@ -66,7 +66,12 @@ function migrate_page_restrictions( $db ) { # We use insert() and not replace() as Article.php replaces # page_restrictions with '' when protected in the restrictions table if ( count( $batch ) ) { - $db->insert( 'page_restrictions', $batch, __FUNCTION__, array( 'IGNORE' ) ); + $ok = $db->deadlockLoop( + array( $db, 'insert' ), + 'page_restrictions', $batch, __FUNCTION__, array( 'IGNORE' ) ); + if( !$ok ) { + throw new MWException( "Deadlock loop failed wtf :(" ); + } } $blockStart += BATCH_SIZE - 1; $blockEnd += BATCH_SIZE - 1;