2021-08-07 12:05:20 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-01-04 19:50:41 +03:00
|
|
|
use function Shlinkio\Shlink\Config\env;
|
2021-08-07 12:05:20 +03:00
|
|
|
|
|
|
|
return (static function (): array {
|
|
|
|
$redisServers = env('REDIS_SERVERS');
|
|
|
|
|
2022-01-01 20:40:48 +03:00
|
|
|
return match ($redisServers) {
|
|
|
|
null => [],
|
2021-08-07 12:05:20 +03:00
|
|
|
default => [
|
|
|
|
'cache' => [
|
2022-01-07 23:37:24 +03:00
|
|
|
'default_lifetime' => 86400, // 24h
|
2021-08-07 12:05:20 +03:00
|
|
|
'redis' => [
|
|
|
|
'servers' => $redisServers,
|
2021-10-08 19:52:17 +03:00
|
|
|
'sentinel_service' => env('REDIS_SENTINEL_SERVICE'),
|
2021-08-07 12:05:20 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
};
|
|
|
|
})();
|