Index: trunk/phase3/maintenance/updateRestrictions.php |
— | — | @@ -66,7 +66,12 @@ |
67 | 67 | # We use insert() and not replace() as Article.php replaces |
68 | 68 | # page_restrictions with '' when protected in the restrictions table |
69 | 69 | 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 | + } |
71 | 76 | } |
72 | 77 | $blockStart += BATCH_SIZE - 1; |
73 | 78 | $blockEnd += BATCH_SIZE - 1; |