Fix unsubscribe bug
This commit is contained in:
parent
4af6065984
commit
1aee05ce16
|
@ -433,7 +433,7 @@ handle_cast({subscribe, From, {PacketId, Properties, TopicFilters}},
|
||||||
handle_cast({unsubscribe, From, {PacketId, _Properties, TopicFilters}},
|
handle_cast({unsubscribe, From, {PacketId, _Properties, TopicFilters}},
|
||||||
State = #state{client_id = ClientId, subscriptions = Subscriptions}) ->
|
State = #state{client_id = ClientId, subscriptions = Subscriptions}) ->
|
||||||
{ReasonCodes, Subscriptions1} =
|
{ReasonCodes, Subscriptions1} =
|
||||||
lists:foldr(fun(Topic, {RcAcc, SubMap}) ->
|
lists:foldr(fun({Topic, _Opts}, {RcAcc, SubMap}) ->
|
||||||
case maps:find(Topic, SubMap) of
|
case maps:find(Topic, SubMap) of
|
||||||
{ok, SubOpts} ->
|
{ok, SubOpts} ->
|
||||||
emqx_broker:unsubscribe(Topic, ClientId),
|
emqx_broker:unsubscribe(Topic, ClientId),
|
||||||
|
@ -649,7 +649,6 @@ retry_delivery(Force, State = #state{inflight = Inflight}) ->
|
||||||
State;
|
State;
|
||||||
false ->
|
false ->
|
||||||
Msgs = lists:sort(sortfun(inflight), emqx_inflight:values(Inflight)),
|
Msgs = lists:sort(sortfun(inflight), emqx_inflight:values(Inflight)),
|
||||||
io:format("!!! Retry Delivery: ~p~n", [Msgs]),
|
|
||||||
retry_delivery(Force, Msgs, os:timestamp(), State)
|
retry_delivery(Force, Msgs, os:timestamp(), State)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue