}
}
- // Ignore warnings about master connections/writes...hard to avoid here
- \Profiler::instance()->getTransactionProfiler()->resetExpectations();
-
$backoffKey = wfMemcKey( 'AuthManager', 'autocreate-failed', md5( $username ) );
if ( $cache->get( $backoffKey ) ) {
$this->logger->debug( __METHOD__ . ': {username} denied by prior creation attempt failures', [
'from' => $from,
] );
+ // Ignore warnings about master connections/writes...hard to avoid here
+ $trxProfiler = \Profiler::instance()->getTransactionProfiler();
+ $trxProfiler->setSilenced( true );
try {
$status = $user->addToDatabase();
if ( !$status->isOk() ) {
return $status;
}
} catch ( \Exception $ex ) {
+ $trxProfiler->setSilenced( false );
$this->logger->error( __METHOD__ . ': {username} failed with exception {exception}', [
'username' => $username,
'exception' => $ex,
// Update user count
\DeferredUpdates::addUpdate( new \SiteStatsUpdate( 0, 0, 0, 0, 1 ) );
-
// Watch user's userpage and talk page
- $user->addWatch( $user->getUserPage(), User::IGNORE_USER_RIGHTS );
+ \DeferredUpdates::addCallableUpdate( function () use ( $user ) {
+ $user->addWatch( $user->getUserPage(), User::IGNORE_USER_RIGHTS );
+ } );
// Log the creation
if ( $this->config->get( 'NewUserLog' ) ) {
// the newly-created user doesn't get lost.
wfGetLBFactory()->commitMasterChanges( __METHOD__ );
+ $trxProfiler->setSilenced( false );
+
if ( $login ) {
$this->setSessionDataForUser( $user );
}