Allow cache namespace to be customizable via env var

This commit is contained in:
Alejandro Celaya 2023-10-06 09:19:55 +02:00
parent 46354baae9
commit 9d8ea0a4f6
4 changed files with 4 additions and 2 deletions

View File

@ -49,7 +49,7 @@
"shlinkio/shlink-config": "dev-main#c0aa01f as 2.5",
"shlinkio/shlink-event-dispatcher": "dev-main#bd3a62b as 3.1",
"shlinkio/shlink-importer": "^5.1",
"shlinkio/shlink-installer": "^8.5",
"shlinkio/shlink-installer": "dev-develop#a665623 as 8.6",
"shlinkio/shlink-ip-geolocation": "^3.2",
"shlinkio/shlink-json": "^1.0",
"spiral/roadrunner": "^2023.2",

View File

@ -16,7 +16,7 @@ return (static function (): array {
return [
'cache' => [
'namespace' => 'Shlink',
'namespace' => EnvVars::CACHE_NAMESPACE->loadFromEnv('Shlink'),
...$cacheRedisBlock,
],
'redis' => $redis,

View File

@ -28,6 +28,7 @@ return [
Option\Visit\VisitsThresholdConfigOption::class,
Option\BasePathConfigOption::class,
Option\TimezoneConfigOption::class,
Option\Cache\CacheNamespaceConfigOption::class,
Option\Worker\TaskWorkerNumConfigOption::class,
Option\Worker\WebWorkerNumConfigOption::class,
Option\Redis\RedisServersConfigOption::class,

View File

@ -17,6 +17,7 @@ enum EnvVars: string
case DB_UNIX_SOCKET = 'DB_UNIX_SOCKET';
case DB_PORT = 'DB_PORT';
case GEOLITE_LICENSE_KEY = 'GEOLITE_LICENSE_KEY';
case CACHE_NAMESPACE = 'CACHE_NAMESPACE';
case REDIS_SERVERS = 'REDIS_SERVERS';
case REDIS_SENTINEL_SERVICE = 'REDIS_SENTINEL_SERVICE';
case REDIS_PUB_SUB_ENABLED = 'REDIS_PUB_SUB_ENABLED';