fix(exclusive): fix xref error && change exclusive default value

This commit is contained in:
firest 2022-06-24 19:41:20 +08:00
parent 85f6846f89
commit b1b1d40528
3 changed files with 4 additions and 4 deletions

View File

@ -70,7 +70,7 @@ check_subscribe(#{clientid := ClientId}, Topic) ->
Fun = fun() -> Fun = fun() ->
try_subscribe(ClientId, Topic) try_subscribe(ClientId, Topic)
end, end,
case mnesia:transaction(Fun) of case mria:transaction(?EXCLUSIVE_SHARD, Fun) of
{atomic, Res} -> {atomic, Res} ->
Res; Res;
{aborted, Reason} -> {aborted, Reason} ->
@ -81,7 +81,7 @@ check_subscribe(#{clientid := ClientId}, Topic) ->
end. end.
unsubscribe(Topic, #{is_exclusive := true}) -> unsubscribe(Topic, #{is_exclusive := true}) ->
_ = mnesia:transaction(fun() -> mnesia:delete({?TAB, Topic}) end), _ = mria:transaction(?EXCLUSIVE_SHARD, fun() -> mnesia:delete({?TAB, Topic}) end),
ok; ok;
unsubscribe(_Topic, _SubOpts) -> unsubscribe(_Topic, _SubOpts) ->
ok. ok.

View File

@ -68,7 +68,7 @@
wildcard_subscription => true, wildcard_subscription => true,
subscription_identifiers => true, subscription_identifiers => true,
shared_subscription => true, shared_subscription => true,
exclusive_subscription => true exclusive_subscription => false
}). }).
-spec check_pub( -spec check_pub(

View File

@ -443,7 +443,7 @@ fields("mqtt") ->
sc( sc(
boolean(), boolean(),
#{ #{
default => true, default => false,
desc => ?DESC(mqtt_exclusive_subscription) desc => ?DESC(mqtt_exclusive_subscription)
} }
)}, )},