jenkins-bot has submitted this change and it was merged.

Change subject: Avoid duplicate autopromote block key fetches
......................................................................


Avoid duplicate autopromote block key fetches

Bug: T133728
Change-Id: Ia3a955547e8147e92c7ca9782e399f9abd6d3949
---
M AbuseFilter.hooks.php
1 file changed, 9 insertions(+), 1 deletion(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php
index 83c005e..e592aa5 100644
--- a/AbuseFilter.hooks.php
+++ b/AbuseFilter.hooks.php
@@ -279,7 +279,15 @@
        public static function onGetAutoPromoteGroups( $user, &$promote ) {
                if ( $promote ) {
                        $key = AbuseFilter::autoPromoteBlockKey( $user );
-                       if ( ObjectCache::getMainStashInstance()->get( $key ) ) 
{
+                       $blocked = ObjectCache::getInstance( 'hash' 
)->getWithSetCallback(
+                               $key,
+                               30,
+                               function () use ( $key ) {
+                                       return 
ObjectCache::getMainStashInstance()->get( $key );
+                               }
+                       );
+
+                       if ( $blocked ) {
                                $promote = array();
                        }
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/286288
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia3a955547e8147e92c7ca9782e399f9abd6d3949
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Se4598 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to