Skip to content

Commit e4e8c2e

Browse files
committed
MC-33275: Stale cache implementation
1 parent 5e0d230 commit e4e8c2e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class RemoteSynchronizedCache extends \Zend_Cache_Backend implements \Zend_Cache
5151
*/
5252
private const REMOTE_SYNC_LOCK_PREFIX = 'rsl::';
5353

54-
5554
/**
5655
* @inheritdoc
5756
*/
@@ -398,10 +397,10 @@ private function unlock(string $id): bool
398397
/**
399398
* Calculate lock name.
400399
*
401-
* @param $id
400+
* @param string $id
402401
* @return string
403402
*/
404-
private function getLockName($id): string
403+
private function getLockName(string $id): string
405404
{
406405
return self::REMOTE_SYNC_LOCK_PREFIX . $id;
407406
}
@@ -451,6 +450,9 @@ private function generateLockSign()
451450
return $sign;
452451
}
453452

453+
/**
454+
* Function that notifies configured cache types to be switched off.
455+
*/
454456
private function notifyStaleCache(): void
455457
{
456458
$this->notifier = $this->notifier ??

setup/src/Magento/Setup/Model/ConfigOptionsList/Cache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class Cache implements ConfigOptionsListInterface
2323
{
2424
const INPUT_VALUE_CACHE_REDIS = 'redis';
25-
const CONFIG_VALUE_CACHE_REDIS = '\\Magento\\Framework\\Cache\\Backend\Redis';
25+
const CONFIG_VALUE_CACHE_REDIS = \Magento\Framework\Cache\Backend\Redis::class;
2626

2727
const INPUT_KEY_CACHE_BACKEND = 'cache-backend';
2828
const INPUT_KEY_CACHE_BACKEND_REDIS_SERVER = 'cache-backend-redis-server';
@@ -44,7 +44,6 @@ class Cache implements ConfigOptionsListInterface
4444
const CONFIG_PATH_CACHE_ID_PREFIX = 'cache/frontend/default/id_prefix';
4545
const CONFIG_PATH_ALLOW_PARALLEL_CACHE_GENERATION = 'cache/allow_parallel_generation';
4646

47-
4847
/**
4948
* @var array
5049
*/
@@ -98,6 +97,7 @@ public function __construct(RedisConnectionValidator $redisValidator)
9897
*/
9998
public function getOptions()
10099
{
100+
$a = \Magento\Framework\Cache\Backend\Redis::class;
101101
return [
102102
new SelectConfigOption(
103103
self::INPUT_KEY_CACHE_BACKEND,

setup/src/Magento/Setup/Model/ConfigOptionsList/PageCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class PageCache implements ConfigOptionsListInterface
2121
{
2222
const INPUT_VALUE_PAGE_CACHE_REDIS = 'redis';
23-
const CONFIG_VALUE_PAGE_CACHE_REDIS = '\\Magento\\Framework\\Cache\\Backend\Redis';
23+
const CONFIG_VALUE_PAGE_CACHE_REDIS = \Magento\Framework\Cache\Backend\Redis::class;
2424

2525
const INPUT_KEY_PAGE_CACHE_BACKEND = 'page-cache';
2626
const INPUT_KEY_PAGE_CACHE_BACKEND_REDIS_SERVER = 'page-cache-redis-server';

0 commit comments

Comments
 (0)