From 8b96893986589e7fd2b4ce18800bb520ee58d403 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 3 Oct 2008 22:23:03 +0000 Subject: [PATCH] add a damn deadlock loop on this thing --- maintenance/updateRestrictions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.20.1