Merge pull request #115 from centuriononon/fix/dc-ids-range

Fix/dc ids range
This commit is contained in:
Sergey Prokhorov 2026-02-26 12:33:58 +01:00 committed by GitHub
commit 421a6cc90c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

1
.gitignore vendored
View file

@ -18,3 +18,4 @@ _build
rebar3.crashdump
*~
config/prod*
.run

View file

@ -65,9 +65,7 @@ start_link(DcId) ->
gen_server:start_link({local, dc_to_pool_name(DcId)}, ?MODULE, DcId, []).
valid_dc_id(DcId) ->
is_integer(DcId) andalso
-10 < DcId andalso
10 > DcId.
is_integer(DcId).
dc_to_pool_name(DcId) ->
valid_dc_id(DcId) orelse error(invalid_dc_id, [DcId]),