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
|
%% 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.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue