diff --git a/rebar.config b/rebar.config index 83b9c8f..8247cf2 100644 --- a/rebar.config +++ b/rebar.config @@ -16,7 +16,7 @@ {deps, [ {getopt, {git, "https://github.com/zmstone/getopt", {tag, "v1.0.2.1"}}}, - {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.9.3"}}} + {emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.9.5"}}} ]}. {escript_name, emqtt_bench}. diff --git a/src/emqtt_bench.erl b/src/emqtt_bench.erl index 0a9189c..1746497 100644 --- a/src/emqtt_bench.erl +++ b/src/emqtt_bench.erl @@ -714,6 +714,7 @@ loop(Parent, N, Client, PubSub, Opts) -> {connected, _Props} -> inc_counter(reconnect_succ), IsSessionPresent = (1 == proplists:get_value(session_present, emqtt:info(Client))), + %% @TODO here we do not really check the subscribe PubSub =:= sub andalso not IsSessionPresent andalso subscribe(Client, N, Opts), loop(Parent, N, Client, PubSub, Opts); Other -> @@ -807,9 +808,8 @@ subscribe(Client, N, Opts) -> }), ok end; - {error, Reason} -> - io:format("client(~w): subscribe error - ~p~n", [N, Reason]), - emqtt:disconnect(Client, ?RC_UNSPECIFIED_ERROR) + {error, Reason}-> + io:format("client(~w): subscribe error - ~p~n", [N, Reason]) end, Res.