redis.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. return [
  12. 'default' => [
  13. 'host' => env('REDIS_HOST', 'localhost'),
  14. 'auth' => env('REDIS_AUTH', null),
  15. 'port' => (int) env('REDIS_PORT', 6379),
  16. 'db' => (int) env('REDIS_DB', 0),
  17. 'timeout' => 0.0,
  18. 'reserved' => null,
  19. 'retry_interval' => 0,
  20. 'cluster' => [
  21. 'enable' => (bool) env('REDIS_CLUSTER_ENABLE', false),
  22. 'name' => null,
  23. 'seeds' => [],
  24. ],
  25. 'sentinel' => [
  26. 'enable' => (bool) env('REDIS_SENTINEL_ENABLE', false),
  27. 'master_name' => env('REDIS_MASTER_NAME', 'mymaster'),
  28. 'nodes' => explode(';', env('REDIS_SENTINEL_NODE', '')),
  29. 'persistent' => '',
  30. 'read_timeout' => 0,
  31. ],
  32. 'pool' => [
  33. 'min_connections' => 1,
  34. 'max_connections' => 10,
  35. 'connect_timeout' => 10.0,
  36. 'wait_timeout' => 3.0,
  37. 'heartbeat' => -1,
  38. 'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 60),
  39. ],
  40. ],
  41. ];