Просмотр исходного кода

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
firest 3 лет назад
Родитель
Сommit
73b4ac9f65
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      apps/emqx_bridge/src/emqx_bridge_resource.erl

+ 2 - 1
apps/emqx_bridge/src/emqx_bridge_resource.erl

@@ -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.