25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Assume we have only one CPU when an auto-detection fails (EJAB-1516)

This commit is contained in:
Evgeniy Khramtsov 2012-02-29 00:45:45 +10:00
parent deb87f2dfa
commit f7b6446c74

View File

@ -380,7 +380,12 @@ do_setopts(#state{procs_num = N} = State, Opts) ->
shrink_size = ShrinkSize}.
get_proc_num() ->
erlang:system_info(logical_processors).
case erlang:system_info(logical_processors) of
unknown ->
1;
Num ->
Num
end.
get_proc_by_hash(Tab, Term) ->
N = erlang:phash2(Term, get_proc_num()) + 1,