From: Aaron Schulz Date: Thu, 10 Jul 2014 18:22:03 +0000 (-0700) Subject: Defer addAutopromoteOnceGroups to transaction idle X-Git-Tag: 1.31.0-rc.0~14950^2 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=f37fff5a0d77c2b00931b7fb5597be8a9c3d2913;p=lhc%2Fweb%2Fwiklou.git Defer addAutopromoteOnceGroups to transaction idle * Extension callbacks in that method can be slow and show up in dbperformance.log sometimes. Change-Id: Idc30c29826e18c4e3287b06d4ce7bae72602e0ea --- diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 7c412ea660..2ff72fd857 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2047,7 +2047,9 @@ class WikiPage implements Page, IDBAccessObject { wfRunHooks( 'PageContentSaveComplete', $hook_args ); // Promote user to any groups they meet the criteria for - $user->addAutopromoteOnceGroups( 'onEdit' ); + $dbw->onTransactionIdle( function() use ( $user ) { + $user->addAutopromoteOnceGroups( 'onEdit' ); + } ); wfProfileOut( __METHOD__ ); return $status;