redis.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. use function Hyperf\Support\env;
  12. return [
  13. 'default' => [
  14. 'host' => env('REDIS_HOST', '127.0.0.1'),
  15. 'auth' => env('REDIS_AUTH', '123456'),
  16. 'port' => (int) env('REDIS_PORT', 6379),
  17. 'db' => (int) env('REDIS_DB', 0),
  18. 'pool' => [
  19. 'min_connections' => 1,
  20. 'max_connections' => 100,
  21. 'connect_timeout' => 100000000.0,
  22. 'wait_timeout' => 30000000.0,
  23. 'heartbeat' => -1,
  24. 'max_idle_time' => (float) env('REDIS_MAX_IDLE_TIME', 6000000000),
  25. ],
  26. 'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
  27. 'redis' => [
  28. 'pool' => 'default'
  29. ],
  30. 'channel' => '{queue:import}',
  31. 'timeout' => 20,
  32. 'retry_seconds' => 5,
  33. 'handle_timeout' => 10,
  34. 'processes' => 100,
  35. 'concurrent' => [
  36. 'limit' => 10000,
  37. ],
  38. 'max_messages' => 0,
  39. ],
  40. 'import' => [
  41. 'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
  42. 'redis' => [
  43. 'pool' => 'default'
  44. ],
  45. 'channel' => '{queue:import}',
  46. 'timeout' => 20,
  47. 'retry_seconds' => 5,
  48. 'handle_timeout' => 10,
  49. 'processes' => 100,
  50. 'concurrent' => [
  51. 'limit' => 10000,
  52. ],
  53. 'max_messages' => 0,
  54. ],
  55. ];