* Only use it on POST requests, where the submit callback really
wants the latest data. The form data will be lagged by user
delay anyway, so using the slave there does not change much.
ChronologyProtector already handles the user seeing their
*own* changes for consecutive updates.
Bug: T92357
Change-Id: I50274ad5f67f6445a89c9d8d6f01d3fca1e9002b
*/
private function getWatchlist() {
$list = array();
- $dbr = wfGetDB( DB_MASTER );
+
+ $index = $this->getRequest()->wasPosted() ? DB_MASTER : DB_SLAVE;
+ $dbr = wfGetDB( $index );
$res = $dbr->select(
'watchlist',
);
if ( $res->numRows() > 0 ) {
+ /** @var Title[] $titles */
$titles = array();
foreach ( $res as $row ) {
$title = Title::makeTitleSafe( $row->wl_namespace, $row->wl_title );