|
1 | 1 | <?php |
2 | | -if (getenv('REDIS_HOST')) { |
| 2 | +if (!getenv('REDIS_HOST_2')) { |
3 | 3 | $CONFIG = array( |
4 | 4 | 'memcache.distributed' => '\OC\Memcache\Redis', |
5 | 5 | 'memcache.locking' => '\OC\Memcache\Redis', |
|
17 | 17 | $CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DB_INDEX'); |
18 | 18 | } |
19 | 19 |
|
20 | | - if (getenv('REDIS_USER_AUTH') !== false) { |
| 20 | + if (getenv('REDIS_USER_AUTH')) { |
21 | 21 | $CONFIG['redis']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH')); |
22 | 22 | } |
| 23 | +} else { |
| 24 | + $CONFIG = array( |
| 25 | + 'memcache.distributed' => '\OC\Memcache\Redis', |
| 26 | + 'memcache.locking' => '\OC\Memcache\Redis', |
| 27 | + 'redis.cluster' => array( |
| 28 | + 'password' => (string) getenv('REDIS_HOST_PASSWORD'), |
| 29 | + 'timeout' => 0.0, |
| 30 | + 'read_timeout' => 0.0, |
| 31 | + 'failover_mode' => \RedisCluster::FAILOVER_ERROR, |
| 32 | + 'seeds' => array( |
| 33 | + getenv('REDIS_HOST') . ':' . (string)getenv('REDIS_PORT'), |
| 34 | + getenv('REDIS_HOST_2') . ':' . (string)getenv('REDIS_PORT_2'), |
| 35 | + getenv('REDIS_HOST_3') . ':' . (string)getenv('REDIS_PORT_3'), |
| 36 | + getenv('REDIS_HOST_4') . ':' . (string)getenv('REDIS_PORT_4'), |
| 37 | + getenv('REDIS_HOST_5') . ':' . (string)getenv('REDIS_PORT_5'), |
| 38 | + getenv('REDIS_HOST_6') . ':' . (string)getenv('REDIS_PORT_6'), |
| 39 | + getenv('REDIS_HOST_7') . ':' . (string)getenv('REDIS_PORT_7'), |
| 40 | + getenv('REDIS_HOST_8') . ':' . (string)getenv('REDIS_PORT_8'), |
| 41 | + getenv('REDIS_HOST_9') . ':' . (string)getenv('REDIS_PORT_9'), |
| 42 | + ), |
| 43 | + ), |
| 44 | + ); |
| 45 | + |
| 46 | + if (getenv('REDIS_USER_AUTH')) { |
| 47 | + $CONFIG['redis.cluster']['user'] = str_replace("&auth[]=", "", getenv('REDIS_USER_AUTH')); |
| 48 | + } |
23 | 49 | } |
0 commit comments