fix(bridge): keep bridge name type as binary don't convert it to atom

After investigation, it was confirmed that there was no need to convert the bridge name to atom
This commit is contained in:
firest 2022-11-01 11:24:24 +08:00
parent a0cd344752
commit 73b4ac9f65
1 changed files with 2 additions and 1 deletions

View File

@ -59,9 +59,10 @@ bridge_id(BridgeType, BridgeName) ->
Type = bin(BridgeType),
<<Type/binary, ":", Name/binary>>.
-spec parse_bridge_id(list() | binary() | atom()) -> {atom(), binary()}.
parse_bridge_id(BridgeId) ->
case string:split(bin(BridgeId), ":", all) of
[Type, Name] -> {binary_to_atom(Type, utf8), binary_to_atom(Name, utf8)};
[Type, Name] -> {binary_to_atom(Type, utf8), Name};
_ -> error({invalid_bridge_id, BridgeId})
end.