Use ObjectCacheFactory instead of deprecated ObjectCache methods

Bug: T363770
Change-Id: I235642d059855a8c5f7296095965687ae73c6efb
This commit is contained in:
Wandji69 2024-05-28 01:24:22 +01:00 committed by Krinkle
parent 40a66cf54f
commit b93b997de5
2 changed files with 5 additions and 5 deletions

View file

@ -7,7 +7,6 @@ use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\SlotRecord;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use ObjectCache;
use TextContent;
/**
@ -374,7 +373,8 @@ abstract class BaseBlacklist {
// FIXME: This is a hack to use Memcached where possible (incl. WMF),
// but have CACHE_DB as fallback (instead of no cache).
// This might be a good candidate for T248005.
$cache = ObjectCache::getInstance( $wgMessageCacheType );
$services = MediaWikiServices::getInstance()->getObjectCacheFactory();
$cache = $services->getInstance( $wgMessageCacheType );
$listType = $this->getBlacklistType();
// There are two keys, when the warning key expires, a random thread will refresh

View file

@ -10,7 +10,6 @@ use MediaWiki\ExternalLinks\ExternalLinksLookup;
use MediaWiki\MediaWikiServices;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use ObjectCache;
use RequestContext;
use Wikimedia\AtEase\AtEase;
use Wikimedia\Rdbms\Database;
@ -62,8 +61,9 @@ class SpamBlacklist extends BaseBlacklist {
$preventLog = false,
$mode = 'check'
) {
$statsd = MediaWikiServices::getInstance()->getStatsdDataFactory();
$cache = ObjectCache::getLocalClusterInstance();
$services = MediaWikiServices::getInstance();
$statsd = $services->getStatsdDataFactory();
$cache = $services->getObjectCacheFactory()->getLocalClusterInstance();
if ( !$links ) {
return false;