Fix QoS tuning
This commit is contained in:
parent
7d0cba9427
commit
645c971a07
|
@ -758,14 +758,12 @@ dequeue2(State = #state{mqueue = Q}) ->
|
|||
tune_qos(Topic, Msg = #message{qos = PubQoS},
|
||||
#state{subscriptions = SubMap, upgrade_qos = UpgradeQoS}) ->
|
||||
case maps:find(Topic, SubMap) of
|
||||
{ok, SubQoS} when UpgradeQoS andalso (SubQoS > PubQoS) ->
|
||||
{ok, #{qos := SubQoS}} when UpgradeQoS andalso (SubQoS > PubQoS) ->
|
||||
Msg#message{qos = SubQoS};
|
||||
{ok, SubQoS} when (not UpgradeQoS) andalso (SubQoS < PubQoS) ->
|
||||
{ok, #{qos := SubQoS}} when (not UpgradeQoS) andalso (SubQoS < PubQoS) ->
|
||||
Msg#message{qos = SubQoS};
|
||||
{ok, _} ->
|
||||
Msg;
|
||||
error ->
|
||||
Msg
|
||||
{ok, _} -> Msg;
|
||||
error -> Msg
|
||||
end.
|
||||
|
||||
%%------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue