fix: check channel id exist when get_channel_status
This commit is contained in:
parent
fd13a661cf
commit
2561ff94ec
|
@ -179,11 +179,14 @@ on_remove_channel(
|
|||
{ok, NewState}.
|
||||
|
||||
on_get_channel_status(
|
||||
_ResId,
|
||||
_ChannelId,
|
||||
_State
|
||||
InstanceId,
|
||||
ChannelId,
|
||||
#{installed_channels := Channels} = State
|
||||
) ->
|
||||
?status_connected.
|
||||
case maps:find(ChannelId, Channels) of
|
||||
{ok, _} -> on_get_status(InstanceId, State);
|
||||
error -> ?status_disconnected
|
||||
end.
|
||||
|
||||
on_get_channels(ResId) ->
|
||||
emqx_bridge_v2:get_channels_for_connector(ResId).
|
||||
|
|
Loading…
Reference in New Issue