Migrage callers away from SiteStatsUpdate::__construct()

Change-Id: I4d81f5f87c93865e8fe1b7986074070376eab8f9
This commit is contained in:
Aaron Schulz 2018-02-11 11:49:27 -08:00 committed by Krinkle
parent 6094897687
commit 331c9f9e2e
2 changed files with 7 additions and 3 deletions

View file

@ -1564,7 +1564,7 @@ abstract class Installer {
$user->saveSettings();
// Update user count
$ssUpdate = new SiteStatsUpdate( 0, 0, 0, 0, 1 );
$ssUpdate = SiteStatsUpdate::factory( [ 'users' => 1 ] );
$ssUpdate->doUpdate();
}
$status = Status::newGood();

View file

@ -2271,7 +2271,9 @@ class WikiPage implements Page, IDBAccessObject {
$edits = $options['changed'] ? 1 : 0;
$total = $options['created'] ? 1 : 0;
DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, $edits, $good, $total ) );
DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
[ 'edits' => $edits, 'articles' => $good, 'total' => $total ]
) );
DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content ) );
// If this is another user's talk page, update newtalk.
@ -3018,7 +3020,9 @@ class WikiPage implements Page, IDBAccessObject {
}
// Update site status
DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, - (int)$countable, -1 ) );
DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
[ 'edits' => 1, 'articles' => -$countable, 'pages' => -1 ]
) );
// Delete pagelinks, update secondary indexes, etc
$updates = $this->getDeletionUpdates( $content );