chore: don't send subscribe msg if topic list is empty

This commit is contained in:
JianBo He 2022-02-22 14:42:10 +08:00
parent 9b53d36571
commit cc3a4f0c5f
1 changed files with 6 additions and 2 deletions

View File

@ -60,8 +60,12 @@ test(_) ->
%% hook %% hook
on_client_connected(ClientInfo, ConnInfo, {TopicHandler, Options}) -> on_client_connected(ClientInfo, ConnInfo, {TopicHandler, Options}) ->
TopicTables = erlang:apply(TopicHandler, handle, [ClientInfo, ConnInfo, Options]), case erlang:apply(TopicHandler, handle, [ClientInfo, ConnInfo, Options]) of
self() ! {subscribe, TopicTables}; [] -> ok;
TopicTables ->
_ = self() ! {subscribe, TopicTables},
ok
end;
on_client_connected(_, _, _) -> on_client_connected(_, _, _) ->
ok. ok.