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

View File

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

View File

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