mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-14 17:55:00 +00:00
Merge "Deduplicate cache keys used to check blockautopromote"
This commit is contained in:
commit
ba9e461ed0
|
@ -294,9 +294,15 @@ class AbuseFilterHooks {
|
|||
|
||||
if ( ( $wgAbuseFilterActions['blockautopromote'] ?? false ) && $promote ) {
|
||||
$cache = ObjectCache::getInstance( 'hash' );
|
||||
$key = AbuseFilter::autoPromoteBlockKey( $cache, $user );
|
||||
// Proxy the blockautopromote data to a faster backend, using an appropriate key
|
||||
$quickCacheKey = $cache->makeKey(
|
||||
'abusefilter',
|
||||
'blockautopromote',
|
||||
'quick',
|
||||
$user->getId()
|
||||
);
|
||||
$blocked = (bool)$cache->getWithSetCallback(
|
||||
$key,
|
||||
$quickCacheKey,
|
||||
$cache::TTL_PROC_LONG,
|
||||
function () use ( $user ) {
|
||||
return AbuseFilter::getAutoPromoteBlockStatus( $user );
|
||||
|
|
Loading…
Reference in a new issue