mirror of
https://github.com/valitydev/capi-v2.git
synced 2024-11-06 10:05:21 +00:00
CAPI-70: add swagger validation pool config to sys.config
This commit is contained in:
parent
87fbe49268
commit
6ee33a454b
@ -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},
|
||||
|
@ -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}
|
||||
}}
|
||||
]}
|
||||
].
|
||||
|
Loading…
Reference in New Issue
Block a user