tgz 2 vuotta sitten
vanhempi
commit
78faecc713
2 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. 3 3
      config/plugin/webman/redis-queue/redis.php
  2. 2 2
      config/redis.php

+ 3 - 3
config/plugin/webman/redis-queue/redis.php

@@ -1,10 +1,10 @@
 <?php
 return [
     'default' => [
-        'host' => 'redis://127.0.0.1:6379',
+        'host' => 'redis://'.getenv('REDIS_HOST').':'.getenv('REDIS_PORT'),
         'options' => [
-            'auth' => null,       // 密码,字符串类型,可选参数
-            'db' => 0,            // 数据库
+            'auth' => !empty(getenv('REDIS_PASSWORD')) ? getenv('REDIS_PASSWORD') : null,       // 密码,字符串类型,可选参数
+            'db' => getenv('REDIS_PORT_DATABASE'),            // 数据库
             'prefix' => '',       // key 前缀
             'max_attempts'  => 3, // 消费失败后,重试次数
             'retry_seconds' => 3, // 重试间隔,单位秒

+ 2 - 2
config/redis.php

@@ -15,8 +15,8 @@
 return [
     'default' => [
         'host' => getenv('REDIS_HOST'),
-        'password' => null,
+        'password' => !empty(getenv('REDIS_PASSWORD')) ? getenv('REDIS_PASSWORD') : null,
         'port' => getenv('REDIS_PORT'),
-        'database' => 0,
+        'database' => getenv('REDIS_PORT_DATABASE'),
     ],
 ];