Merge pull request #10663 from qzhuyan/dev/william/fix-gateway-mqttsn-nolocal

chore(gateway-mqttsn): fix a minor bug
This commit is contained in:
William Yang 2023-05-10 13:13:48 +02:00 committed by GitHub
commit ec6cac88c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{application, emqx_gateway_mqttsn, [
{description, "MQTT-SN Gateway"},
{vsn, "0.1.0"},
{vsn, "0.1.1"},
{registered, []},
{applications, [kernel, stdlib, emqx, emqx_gateway]},
{env, []},

View File

@ -2045,15 +2045,15 @@ handle_deliver(
ignore_local(Delivers, Subscriber, Session, Ctx) ->
Subs = emqx_session:info(subscriptions, Session),
lists:dropwhile(
lists:filter(
fun({deliver, Topic, #message{from = Publisher}}) ->
case maps:find(Topic, Subs) of
{ok, #{nl := 1}} when Subscriber =:= Publisher ->
ok = metrics_inc(Ctx, 'delivery.dropped'),
ok = metrics_inc(Ctx, 'delivery.dropped.no_local'),
true;
false;
_ ->
false
true
end
end,
Delivers