Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9e47ba

Browse files
author
André R
committed
Update doc & review fixes
1 parent85dd875 commitf9e47ba

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

‎src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
useSymfony\Component\Cache\Traits\RedisTrait;
1919

2020
/**
21-
* Stores tag id <> cache id relationship as a Redis Set, lookup on invalidation usingsPOP.
21+
* Stores tag id <> cache id relationship as a Redis Set, lookup on invalidation usingRENAME+SMEMBERS.
2222
*
2323
* Set (tag relation info) is stored without expiry (non-volatile), while cache always gets an expiry (volatile) even
2424
* if not set by caller. Thus if you configure redis with the right eviction policy you can be safe this tag <> cache
2525
* relationship survives eviction (cache cleanup when Redis runs out of memory).
2626
*
2727
* Requirements:
2828
* - Client: PHP Redis or Predis
29-
* Due to lack of RENAME support it isnot recommended to usePredisCluster, instead useRedisCluster.
29+
*Note:Due to lack of RENAME support it isNOT recommended to useCluster on Predis, instead usephpredis.
3030
* - Server: Redis 2.8+
3131
* Configured with any `volatile-*` eviction policy, OR `noeviction` if it will NEVER fill up memory
3232
*
3333
* Design limitations:
3434
* - Max 4 billion cache keys per cache tag as limited by Redis Set datatype.
35-
* E.g. If you use a "all" items tag for expiry instead of clear(), that limits you to 4 billion cache itemsas well.
35+
* E.g. If you use a "all" items tag for expiry instead of clear(), that limits you to 4 billion cache itemsalso.
3636
*
3737
* @see https://redis.io/topics/lru-cache#eviction-policies Documentation for Redis eviction policies.
3838
* @see https://redis.io/topics/data-types#sets Documentation for Redis Set datatype.
@@ -144,10 +144,7 @@ protected function doDelete(array $ids, array $tagData = []): bool
144144
protectedfunctiondoInvalidate(array$tagIds):bool
145145
{
146146
if ($this->redisinstanceof \Predis\ClientInterface &&$this->redis->getConnection()instanceof ClusterInterface) {
147-
CacheItem::log(
148-
$this->logger,
149-
'Cluster on Predis does not support RENAME so there is a risk of race conditions on tag invalidation, please use phpredis instead.'
150-
);
147+
CacheItem::log($this->logger,'Cluster on Predis does not support RENAME so there is a risk of race conditions on tag invalidation, use phpredis instead.');
151148
$movedTagSetIds =$tagIds;
152149
}else {
153150
$movedTagSetIds =$this->renameKeys($tagIds);
@@ -179,13 +176,13 @@ protected function doInvalidate(array $tagIds): bool
179176
/**
180177
* Rename several keys in order to be able to operate on them without risk of race conditions.
181178
*
182-
* Filters out keys that does notexists before returning new keys.
179+
* Filters out keys that does notexist before returning new keys.
183180
*
184181
* @see https://redis.io/commands/rename
185182
*
186-
* @param array $idsthe Orginal cacheid's
183+
* @param array $idsThe original cacheids
187184
*
188-
* @return arrayfiltered list of the valid moved keys (only those that existed)
185+
* @return arrayFiltered list of the valid moved keys (only those that existed)
189186
*/
190187
privatefunctionrenameKeys(array$ids):array
191188
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp