CAPI-70: add swagger validation pool config to sys.config

This commit is contained in:
Anton Belyaev 2017-04-19 12:56:27 +03:00 committed by Anton Belyaev
parent 87fbe49268
commit 6ee33a454b
2 changed files with 17 additions and 2 deletions

View File

@ -12,6 +12,12 @@
%%
-define(DEFAULT_SWAG_POOL_OPTS, #{
max_count => 10,
init_count => 10,
cull_interval => {0, min}
}).
-spec start_link() -> {ok, pid()} | {error, {already_started, pid()}}.
start_link() ->
@ -25,12 +31,14 @@ init([]) ->
AuthorizerSpecs = get_authorizer_child_specs(),
{LogicHandler, LogicHandlerSpecs} = get_logic_handler_info(),
{ok, IP} = inet:parse_address(genlib_app:env(?MODULE, ip, "::")),
PoolOpts = genlib_app:env(swagger, validator_pool_opts, ?DEFAULT_SWAG_POOL_OPTS),
SwaggerSpec = swagger_server:child_spec(swagger, #{
ip => IP,
port => genlib_app:env(capi, port, 8080),
net_opts => [],
logic_handler => LogicHandler,
cowboy_extra_opts => get_cowboy_extra_opts()
cowboy_extra_opts => get_cowboy_extra_opts(),
validator_pool_opts => PoolOpts
}),
{ok, {
{one_for_all, 0, 1},

View File

@ -38,6 +38,13 @@
repository => "http://dominant:8022/v1/domain/repository",
merchant_config => "http://pimp:8022/capi"
}}
]}
]},
{swagger, [
{validator_pool_opts, #{
max_count => 10,
init_count => 10,
cull_interval => {0, min}
}}
]}
].