浏览代码

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

After investigation, it was confirmed that there was no need to convert the connector name to atom
firest 3 年之前
父节点
当前提交
d0687c7aaa
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      apps/emqx_connector/src/emqx_connector.erl

+ 2 - 1
apps/emqx_connector/src/emqx_connector.erl

@@ -78,9 +78,10 @@ connector_id(Type0, Name0) ->
     Name = bin(Name0),
     <<Type/binary, ":", Name/binary>>.
 
+-spec parse_connector_id(binary() | list() | atom()) -> {atom(), binary()}.
 parse_connector_id(ConnectorId) ->
     case string:split(bin(ConnectorId), ":", all) of
-        [Type, Name] -> {binary_to_atom(Type, utf8), binary_to_atom(Name, utf8)};
+        [Type, Name] -> {binary_to_atom(Type, utf8), Name};
         _ -> error({invalid_connector_id, ConnectorId})
     end.