Trigger count refreshes more often during updates instead.
Change-Id: I0f4575e648109befb86a2c8f08b491a132fe56c3
$totalcnt = $dbcnt;
} elseif ( $rescnt < $this->limit && !$fromOrUntil ) {
// Case 2: not sane, but salvageable. Use the number of results.
- // Since there are fewer than 200, we can also take this opportunity
- // to refresh the incorrect category table entry -- which should be
- // quick due to the small number of entries.
$totalcnt = $rescnt;
- DeferredUpdates::addCallableUpdate( [ $this->cat, 'refreshCounts' ] );
} else {
// Case 3: hopeless. Don't give a total count at all.
// Messages: category-subcat-count-limited, category-article-count-limited,
}
}
- // Refresh the category table entry if it seems to have no pages. Check
- // master for the most up-to-date cat_pages count.
+ // Refresh counts on categories that should be empty now
if ( $title->getNamespace() === NS_CATEGORY ) {
$row = $dbw->selectRow(
'category',
[ 'cat_id', 'cat_title', 'cat_pages', 'cat_subcats', 'cat_files' ],
- [ 'cat_title' => $title->getDBkey(), 'cat_pages <= 0' ],
+ [ 'cat_title' => $title->getDBkey(), 'cat_pages <= 100' ],
__METHOD__
);
if ( $row ) {
Hooks::run( 'CategoryAfterPageRemoved', [ $cat, $this, $id ] );
}
- // Refresh counts on categories that should be empty now, to
- // trigger possible deletion. Check master for the most
- // up-to-date cat_pages.
+ // Refresh counts on categories that should be empty now
if ( count( $deleted ) ) {
$rows = $dbw->select(
'category',
[ 'cat_id', 'cat_title', 'cat_pages', 'cat_subcats', 'cat_files' ],
- [ 'cat_title' => $deleted, 'cat_pages <= 0' ],
+ [ 'cat_title' => $deleted, 'cat_pages <= 100' ],
__METHOD__
);
foreach ( $rows as $row ) {