mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 10:48:17 +00:00
Avoid duplicate autopromote block key fetches
Bug: T133728 Change-Id: Ia3a955547e8147e92c7ca9782e399f9abd6d3949
This commit is contained in:
parent
ef7a80ba60
commit
2807b5883a
|
@ -279,7 +279,15 @@ class AbuseFilterHooks {
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue