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

Appearance settings

Commit 9ab2435

Browse filesBrowse files
tourzenicolas-grekas
authored andcommitted
[Cache] Compatible with aliyun redis instance
Some cloud provider's redis instance is just compatible in common use command, but not some special command. Just like aliyun redis instance, doc: https://help.aliyun.com/document_detail/26342.html It based on redis protocol, but not really like the redis I know... I found that `$host->info('Memory')` will return false/null sometime, so and more safe check will be better for those special redis server.
1 parent debae84 commit 9ab2435
Copy full SHA for 9ab2435

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,13 @@ private function getRedisEvictionPolicy(): string
292292
foreach ($hosts as $host) {
293293
$info = $host->info('Memory');
294294

295-
if ($info instanceof ErrorInterface) {
295+
if (false === $info || null === $info || $info instanceof ErrorInterface) {
296296
continue;
297297
}
298298

299299
$info = $info['Memory'] ?? $info;
300300

301-
return $this->redisEvictionPolicy = $info['maxmemory_policy'];
301+
return $this->redisEvictionPolicy = $info['maxmemory_policy'] ?? '';
302302
}
303303

304304
return $this->redisEvictionPolicy = '';

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.