Merge "Avoid scoped lock errors in Category::refreshCounts() due to nesting"

This commit is contained in:
jenkins-bot 2017-06-02 23:28:02 +00:00 committed by Gerrit Code Review
commit 9c8ff2fac0
2 changed files with 9 additions and 2 deletions

View file

@ -106,7 +106,11 @@ class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate {
__METHOD__
);
if ( $row ) {
Category::newFromRow( $row, $title )->refreshCounts();
$cat = Category::newFromRow( $row, $title );
// T166757: do the update after the main job DB commit
DeferredUpdates::addCallableUpdate( function () use ( $cat ) {
$cat->refreshCounts();
} );
}
}

View file

@ -3496,7 +3496,10 @@ class WikiPage implements Page, IDBAccessObject {
);
foreach ( $rows as $row ) {
$cat = Category::newFromRow( $row );
$cat->refreshCounts();
// T166757: do the update after this DB commit
DeferredUpdates::addCallableUpdate( function () use ( $cat ) {
$cat->refreshCounts();
} );
}
}
}