From d0687c7aaa24487404e9f6c725ddd2b88042104d Mon Sep 17 00:00:00 2001 From: firest Date: Tue, 1 Nov 2022 15:36:31 +0800 Subject: [PATCH] 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 --- apps/emqx_connector/src/emqx_connector.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/emqx_connector/src/emqx_connector.erl b/apps/emqx_connector/src/emqx_connector.erl index d85959698..1ce4d982a 100644 --- a/apps/emqx_connector/src/emqx_connector.erl +++ b/apps/emqx_connector/src/emqx_connector.erl @@ -78,9 +78,10 @@ connector_id(Type0, Name0) -> Name = bin(Name0), <>. +-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.