Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/286288

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/88/286288/1

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: newchange
Gerrit-Change-Id: Ia3a955547e8147e92c7ca9782e399f9abd6d3949
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

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

Reply via email to