chore: put the pool_size default value to avoid hot upgrade failure

This commit is contained in:
JianBo He 2021-11-10 18:40:40 +08:00 committed by JianBo He
parent e7ccd88719
commit 34cc8cc7f5
2 changed files with 4 additions and 2 deletions

View File

@ -300,7 +300,9 @@ put_pool_size(Val) ->
persistent_term:put({?APP, pool_size}, Val).
get_pool_size() ->
persistent_term:get({?APP, pool_size}).
%% Avoid the scenario that the parameter is not set after
%% the hot upgrade completed.
persistent_term:get({?APP, pool_size}, erlang:system_info(schedulers)).
save(Name, ServerState) ->
Saved = persistent_term:get(?APP, []),

View File

@ -295,7 +295,7 @@ on_session_terminated(Req, Md) ->
| {error, grpc_cowboy_h:error_response()}.
on_message_publish(#{message := #{from := From} = Msg} = Req, Md) ->
?MODULE:in({?FUNCTION_NAME, Req}),
io:format(standard_error, "fun: ~p, req: ~0p~n", [?FUNCTION_NAME, Req]),
%io:format("fun: ~p, req: ~0p~n", [?FUNCTION_NAME, Req]),
%% some cases for testing
case From of
<<"baduser">> ->