Join GitHub today
[5.8] Use ClusterInterface instead of PredisCluster #28706
There is an issue when running the
php artisan cache:clear Predis\NotSupportedException : Cannot use 'FLUSHDB' with redis-cluster.
The reason why
There is logic to check whether the connection is using a cluster or single node, which determines how the flush command should be executed. However the condition for this check isn't working correctly.
The current logic checks to see if the connection is an instance of
The proposed solution
Both of these classes implement the
My Redis config in
'redis' => [ 'client' => 'predis', 'options' => [ 'cluster' => 'redis', ], 'clusters' => [ 'default' => [ 'parameters' => [ 'host' => '127.0.0.1', 'password' => null, 'port' => 6379, ], ], ], ],