fix(exclusive): fix xref error && change exclusive default value
This commit is contained in:
parent
85f6846f89
commit
b1b1d40528
|
@ -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.
|
||||||
|
|
|
@ -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(
|
||||||
|
|
|
@ -443,7 +443,7 @@ fields("mqtt") ->
|
||||||
sc(
|
sc(
|
||||||
boolean(),
|
boolean(),
|
||||||
#{
|
#{
|
||||||
default => true,
|
default => false,
|
||||||
desc => ?DESC(mqtt_exclusive_subscription)
|
desc => ?DESC(mqtt_exclusive_subscription)
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
|
|
Loading…
Reference in New Issue