perf: 增加原生缓存
This commit is contained in:
25
vendor/illuminate/redis/Connections/PredisClusterConnection.php
vendored
Normal file
25
vendor/illuminate/redis/Connections/PredisClusterConnection.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Redis\Connections;
|
||||
|
||||
use Predis\Command\Redis\FLUSHDB;
|
||||
use Predis\Command\ServerFlushDatabase;
|
||||
|
||||
class PredisClusterConnection extends PredisConnection
|
||||
{
|
||||
/**
|
||||
* Flush the selected Redis database on all cluster nodes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function flushdb()
|
||||
{
|
||||
$command = class_exists(ServerFlushDatabase::class)
|
||||
? ServerFlushDatabase::class
|
||||
: FLUSHDB::class;
|
||||
|
||||
foreach ($this->client as $node) {
|
||||
$node->executeCommand(tap(new $command)->setArguments(func_get_args()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user