Merge pull request #1891 from acelaya-forks/feature/customizable-cache-namespace

Feature/customizable cache namespace
This commit is contained in:
Alejandro Celaya 2023-10-07 11:33:40 +02:00 committed by GitHub
commit d419b9d62d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 4 deletions

View file

@ -12,6 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
When trying to delete orphan visits the result will also be `0` and no visits will actually get deleted.
* [#1879](https://github.com/shlinkio/shlink/issues/1879) Cache namespace can now be customized via config option or `CACHE_NAMESPACE` env var.
This is important if you are running multiple Shlink instance on the same server, or they share the same Redis instance (even more so if they are on different versions).
### Changed
* [#1799](https://github.com/shlinkio/shlink/issues/1799) RoadRunner/openswoole jobs are not run anymore for tasks that are actually disabled.

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",
@ -72,7 +72,7 @@
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/php-code-coverage": "^10.1",
"phpunit/phpunit": "^10.3",
"phpunit/phpunit": "^10.4",
"roave/security-advisories": "dev-master",
"shlinkio/php-coding-standard": "~2.3.0",
"shlinkio/shlink-test-utils": "^3.7.1",

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

@ -22,8 +22,9 @@ class CliTestUtils
$generator = new Generator();
}
$command = $generator->getMock(
$command = $generator->testDouble(
Command::class,
mockObject: true,
callOriginalConstructor: false,
callOriginalClone: false,
cloneArguments: false,

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';