PhpRedisClusterConnection.php 594 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Illuminate\Redis\Connections;
  3. class PhpRedisClusterConnection extends PhpRedisConnection
  4. {
  5. /**
  6. * Flush the selected Redis database on all master nodes.
  7. *
  8. * @return mixed
  9. */
  10. public function flushdb()
  11. {
  12. $arguments = func_get_args();
  13. $async = strtoupper((string) ($arguments[0] ?? null)) === 'ASYNC';
  14. foreach ($this->client->_masters() as $master) {
  15. $async
  16. ? $this->command('rawCommand', [$master, 'flushdb', 'async'])
  17. : $this->command('flushdb', [$master]);
  18. }
  19. }
  20. }