Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cache] Fix perf when using RedisCluster by reducing roundtrips to th…
…e servers This is slimmed down version of: #28269 _(many of the fixes here are already part of 3.4)_ Adds: - Test coverage for Predis with RedisCluster - Removes usage of key versioning when on RedisCluster, besides performance aspect of that simplify / aligning clear() handling across cases
- Loading branch information
1 parent
21d0197
commit dacf179
Showing
2 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/Symfony/Component/Cache/Tests/Adapter/PredisRedisClusterAdapterTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Cache\Tests\Adapter; | ||
|
||
class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest | ||
{ | ||
public static function setupBeforeClass() | ||
{ | ||
if (!$hosts = getenv('REDIS_CLUSTER_HOSTS')) { | ||
self::markTestSkipped('REDIS_CLUSTER_HOSTS env var is not defined.'); | ||
} | ||
self::$redis = new \Predis\Client(explode(' ', $hosts), ['cluster' => 'redis']); | ||
} | ||
|
||
public static function tearDownAfterClass() | ||
{ | ||
self::$redis = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters