Merge pull request #10663 from qzhuyan/dev/william/fix-gateway-mqttsn-nolocal
chore(gateway-mqttsn): fix a minor bug
This commit is contained in:
commit
ec6cac88c9
|
@ -1,6 +1,6 @@
|
||||||
{application, emqx_gateway_mqttsn, [
|
{application, emqx_gateway_mqttsn, [
|
||||||
{description, "MQTT-SN Gateway"},
|
{description, "MQTT-SN Gateway"},
|
||||||
{vsn, "0.1.0"},
|
{vsn, "0.1.1"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib, emqx, emqx_gateway]},
|
{applications, [kernel, stdlib, emqx, emqx_gateway]},
|
||||||
{env, []},
|
{env, []},
|
||||||
|
|
|
@ -2045,15 +2045,15 @@ handle_deliver(
|
||||||
|
|
||||||
ignore_local(Delivers, Subscriber, Session, Ctx) ->
|
ignore_local(Delivers, Subscriber, Session, Ctx) ->
|
||||||
Subs = emqx_session:info(subscriptions, Session),
|
Subs = emqx_session:info(subscriptions, Session),
|
||||||
lists:dropwhile(
|
lists:filter(
|
||||||
fun({deliver, Topic, #message{from = Publisher}}) ->
|
fun({deliver, Topic, #message{from = Publisher}}) ->
|
||||||
case maps:find(Topic, Subs) of
|
case maps:find(Topic, Subs) of
|
||||||
{ok, #{nl := 1}} when Subscriber =:= Publisher ->
|
{ok, #{nl := 1}} when Subscriber =:= Publisher ->
|
||||||
ok = metrics_inc(Ctx, 'delivery.dropped'),
|
ok = metrics_inc(Ctx, 'delivery.dropped'),
|
||||||
ok = metrics_inc(Ctx, 'delivery.dropped.no_local'),
|
ok = metrics_inc(Ctx, 'delivery.dropped.no_local'),
|
||||||
true;
|
false;
|
||||||
_ ->
|
_ ->
|
||||||
false
|
true
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
Delivers
|
Delivers
|
||||||
|
|
Loading…
Reference in New Issue