fix: undefined_functions dialyzer warning

This commit is contained in:
JimMoen 2022-08-11 22:54:32 +08:00
parent ed796acb95
commit 458dab53c5
1 changed files with 6 additions and 2 deletions

View File

@ -37,6 +37,7 @@
remove/4, remove/4,
update/2, update/2,
update/3, update/3,
update/4,
stop/2, stop/2,
restart/2, restart/2,
reset_metrics/1 reset_metrics/1
@ -111,6 +112,9 @@ update(BridgeId, {OldConf, Conf}) ->
update(BridgeType, BridgeName, {OldConf, Conf}). update(BridgeType, BridgeName, {OldConf, Conf}).
update(Type, Name, {OldConf, Conf}) -> update(Type, Name, {OldConf, Conf}) ->
update(Type, Name, {OldConf, Conf}, #{}).
update(Type, Name, {OldConf, Conf}, Opts) ->
%% TODO: sometimes its not necessary to restart the bridge connection. %% TODO: sometimes its not necessary to restart the bridge connection.
%% %%
%% - if the connection related configs like `servers` is updated, we should restart/start %% - if the connection related configs like `servers` is updated, we should restart/start
@ -127,7 +131,7 @@ update(Type, Name, {OldConf, Conf}) ->
name => Name, name => Name,
config => Conf config => Conf
}), }),
case recreate(Type, Name, Conf) of case recreate(Type, Name, Conf, Opts) of
{ok, _} -> {ok, _} ->
maybe_disable_bridge(Type, Name, Conf); maybe_disable_bridge(Type, Name, Conf);
{error, not_found} -> {error, not_found} ->
@ -137,7 +141,7 @@ update(Type, Name, {OldConf, Conf}) ->
name => Name, name => Name,
config => Conf config => Conf
}), }),
create(Type, Name, Conf); create(Type, Name, Conf, Opts);
{error, Reason} -> {error, Reason} ->
{error, {update_bridge_failed, Reason}} {error, {update_bridge_failed, Reason}}
end; end;