From 95c7b0e7cbc7ce4915496da0b6e72747330b2c2c Mon Sep 17 00:00:00 2001 From: Andrey Mayorov Date: Mon, 18 Dec 2017 18:42:08 +0300 Subject: [PATCH] MSPF-320: Remove deprecared call --- apps/shortener/src/shortener_swagger_server.erl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/shortener/src/shortener_swagger_server.erl b/apps/shortener/src/shortener_swagger_server.erl index 06780dd..9d9e43b 100644 --- a/apps/shortener/src/shortener_swagger_server.erl +++ b/apps/shortener/src/shortener_swagger_server.erl @@ -3,7 +3,7 @@ -export([child_spec/2]). -define(APP, shortener). --define(DEFAULT_ACCEPTORS_POOLSIZE, 100). +-define(DEFAULT_ACCEPTORS_POOLSIZE, 10). -define(DEFAULT_IP_ADDR, "::"). -define(DEFAULT_PORT, 8080). @@ -12,10 +12,8 @@ child_spec(LogicHandler, Opts) -> {Transport, TransportOpts} = get_socket_transport(Opts), CowboyOpts = get_cowboy_config(LogicHandler, Opts), - Acceptors = maps:get(acceptors, Opts, ?DEFAULT_ACCEPTORS_POOLSIZE), ranch:child_spec( ?MODULE, - Acceptors, Transport, TransportOpts, cowboy_protocol, @@ -25,7 +23,8 @@ child_spec(LogicHandler, Opts) -> get_socket_transport(Opts) -> {ok, IP} = inet:parse_address(maps:get(ip, Opts, ?DEFAULT_IP_ADDR)), Port = maps:get(port, Opts, ?DEFAULT_PORT), - {ranch_tcp, [{ip, IP}, {port, Port}]}. + Acceptors = maps:get(acceptors, Opts, ?DEFAULT_ACCEPTORS_POOLSIZE), + {ranch_tcp, [{ip, IP}, {port, Port}, {num_acceptors, Acceptors}]}. get_cowboy_config(LogicHandler, Opts) -> ShortUrlTemplate = maps:get(short_url_template, Opts),