chore: don't send subscribe msg if topic list is empty
This commit is contained in:
parent
9b53d36571
commit
cc3a4f0c5f
|
@ -60,8 +60,12 @@ test(_) ->
|
|||
%% hook
|
||||
|
||||
on_client_connected(ClientInfo, ConnInfo, {TopicHandler, Options}) ->
|
||||
TopicTables = erlang:apply(TopicHandler, handle, [ClientInfo, ConnInfo, Options]),
|
||||
self() ! {subscribe, TopicTables};
|
||||
case erlang:apply(TopicHandler, handle, [ClientInfo, ConnInfo, Options]) of
|
||||
[] -> ok;
|
||||
TopicTables ->
|
||||
_ = self() ! {subscribe, TopicTables},
|
||||
ok
|
||||
end;
|
||||
on_client_connected(_, _, _) ->
|
||||
ok.
|
||||
|
||||
|
|
Loading…
Reference in New Issue