From 73b4ac9f656b86f3a173689086f4176a75b6dc2a Mon Sep 17 00:00:00 2001 From: firest Date: Tue, 1 Nov 2022 11:24:24 +0800 Subject: [PATCH] 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 --- apps/emqx_bridge/src/emqx_bridge_resource.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/emqx_bridge/src/emqx_bridge_resource.erl b/apps/emqx_bridge/src/emqx_bridge_resource.erl index d19cc8426..cbfeda4ba 100644 --- a/apps/emqx_bridge/src/emqx_bridge_resource.erl +++ b/apps/emqx_bridge/src/emqx_bridge_resource.erl @@ -59,9 +59,10 @@ bridge_id(BridgeType, BridgeName) -> Type = bin(BridgeType), <>. +-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.