fix: tolerate existing eventhub_counters ETS on infra_mnesia restart
Supervisor restarts after mnesia_stopped crashed on ets:new already_exists.
This commit is contained in:
@@ -36,7 +36,11 @@
|
|||||||
|
|
||||||
start_link() ->
|
start_link() ->
|
||||||
% Счётчики для метрик (сессии, ws-соединения)
|
% Счётчики для метрик (сессии, ws-соединения)
|
||||||
ets:new(eventhub_counters, [named_table, public, set, {write_concurrency, true}]),
|
case ets:info(eventhub_counters) of
|
||||||
|
undefined ->
|
||||||
|
ets:new(eventhub_counters, [named_table, public, set, {write_concurrency, true}]);
|
||||||
|
_ -> ok
|
||||||
|
end,
|
||||||
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
|
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
|
||||||
|
|
||||||
init_tables() ->
|
init_tables() ->
|
||||||
|
|||||||
Reference in New Issue
Block a user