Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Illuminate/Cache/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
class RedisStore extends TaggableStore implements LockProvider
{
use RetrievesMultipleKeys {
many as private manyAlias;
putMany as private putManyAlias;
}

Expand Down Expand Up @@ -92,6 +93,11 @@ public function many(array $keys)

$connection = $this->connection();

// PredisClusterConnection does not support reading multiple values if the keys hash differently...
if ($connection instanceof PredisClusterConnection) {
return $this->manyAlias($keys);
}

$values = $connection->mget(array_map(function ($key) {
return $this->prefix.$key;
}, $keys));
Expand Down
11 changes: 2 additions & 9 deletions tests/Integration/Cache/MemoizedStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
use Illuminate\Cache\Events\WritingKey;
use Illuminate\Contracts\Cache\Store;
use Illuminate\Foundation\Testing\Concerns\InteractsWithRedis;
use Illuminate\Redis\Connections\PhpRedisClusterConnection;
use Illuminate\Redis\Connections\PredisClusterConnection;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Event;
Expand All @@ -33,14 +31,9 @@ protected function setUp(): void

$this->setUpRedis();

$connection = $this->app['redis']->connection();
$this->markTestSkippedWhen(
$connection instanceof PhpRedisClusterConnection || $connection instanceof PredisClusterConnection,
'flushAll and many currently not supported for Redis Cluster connections',
);

Config::set('cache.default', 'redis');
Redis::flushAll();
Redis::connection(Config::get('cache.stores.redis.connection'))->flushDb();
Redis::connection(Config::get('cache.stores.redis.lock_connection'))->flushDb();
}

protected function tearDown(): void
Expand Down
Loading