Added workers nums handling to simplified config parser

This commit is contained in:
Alejandro Celaya
2019-11-10 12:04:14 +01:00
parent cbe2c362d5
commit d4005da35c
3 changed files with 16 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ class SimplifiedConfigParser
'delete_short_url_threshold' => ['delete_short_urls', 'visits_threshold'],
'redis_servers' => ['redis', 'servers'],
'base_path' => ['router', 'base_path'],
'web_worker_num' => ['zend-expressive-swoole', 'swoole-http-server', 'options', 'worker_num'],
'task_worker_num' => ['zend-expressive-swoole', 'swoole-http-server', 'options', 'task_worker_num'],
];
private const SIMPLIFIED_CONFIG_SIDE_EFFECTS = [
'delete_short_url_threshold' => [

View File

@@ -52,6 +52,7 @@ class SimplifiedConfigParserTest extends TestCase
'port' => '1234',
],
'base_path' => '/foo/bar',
'task_worker_num' => 50,
];
$expected = [
'app_options' => [
@@ -102,6 +103,14 @@ class SimplifiedConfigParserTest extends TestCase
'not_found_redirects' => [
'invalid_short_url' => 'foobar.com',
],
'zend-expressive-swoole' => [
'swoole-http-server' => [
'options' => [
'task_worker_num' => 50,
],
],
],
];
$result = ($this->postProcessor)(array_merge($config, $simplified));