mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-26 23:18:37 +03:00
Updated config to read redis from config.redis
This commit is contained in:
parent
abe54c67d8
commit
4fadd523f1
4 changed files with 23 additions and 12 deletions
|
@ -1,13 +1,16 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
|
||||
'redis' => [
|
||||
'servers' => 'tcp://shlink_redis:6379',
|
||||
// 'servers' => [
|
||||
// 'tcp://shlink_redis:6379',
|
||||
// ],
|
||||
'cache' => [
|
||||
'redis' => [
|
||||
'servers' => 'tcp://shlink_redis:6379',
|
||||
// 'servers' => [
|
||||
// 'tcp://shlink_redis:6379',
|
||||
// ],
|
||||
],
|
||||
],
|
||||
|
||||
'dependencies' => [
|
||||
|
|
|
@ -62,6 +62,12 @@ $helper = new class {
|
|||
$webhooks = env('VISITS_WEBHOOKS');
|
||||
return $webhooks === null ? [] : explode(',', $webhooks);
|
||||
}
|
||||
|
||||
public function getRedisConfig(): ?array
|
||||
{
|
||||
$redisServers = env('REDIS_SERVERS');
|
||||
return $redisServers === null ? null : ['servers' => $redisServers];
|
||||
}
|
||||
};
|
||||
|
||||
return [
|
||||
|
@ -112,8 +118,8 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'servers' => env('REDIS_SERVERS'),
|
||||
'cache' => [
|
||||
'redis' => $helper->getRedisConfig(),
|
||||
],
|
||||
|
||||
'router' => [
|
||||
|
|
|
@ -27,7 +27,7 @@ class SimplifiedConfigParser
|
|||
'base_url_redirect_to' => ['not_found_redirects', 'base_path'],
|
||||
'db_config' => ['entity_manager', 'connection'],
|
||||
'delete_short_url_threshold' => ['delete_short_urls', 'visits_threshold'],
|
||||
'redis_servers' => ['redis', 'servers'],
|
||||
'redis_servers' => ['cache', 'redis', 'servers'],
|
||||
'base_path' => ['router', 'base_path'],
|
||||
'web_worker_num' => ['mezzio-swoole', 'swoole-http-server', 'options', 'worker_num'],
|
||||
'task_worker_num' => ['mezzio-swoole', 'swoole-http-server', 'options', 'task_worker_num'],
|
||||
|
|
|
@ -97,10 +97,12 @@ class SimplifiedConfigParserTest extends TestCase
|
|||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'servers' => [
|
||||
'tcp://1.1.1.1:1111',
|
||||
'tcp://1.2.2.2:2222',
|
||||
'cache' => [
|
||||
'redis' => [
|
||||
'servers' => [
|
||||
'tcp://1.1.1.1:1111',
|
||||
'tcp://1.2.2.2:2222',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
|
|
Loading…
Reference in a new issue