Merge pull request #12747 from ieQu1/dev/bulk-ds-kickout
fix(mgmt): Fix bulk kickout of durable sessions
This commit is contained in:
commit
be88e906a0
|
@ -205,13 +205,14 @@ destroy(#{clientid := ClientID}) ->
|
||||||
destroy_session(ClientID) ->
|
destroy_session(ClientID) ->
|
||||||
session_drop(ClientID, destroy).
|
session_drop(ClientID, destroy).
|
||||||
|
|
||||||
|
-spec kick_offline_session(emqx_types:clientid()) -> ok.
|
||||||
kick_offline_session(ClientID) ->
|
kick_offline_session(ClientID) ->
|
||||||
emqx_cm_locker:trans(
|
case emqx_persistent_message:is_persistence_enabled() of
|
||||||
ClientID,
|
true ->
|
||||||
fun(_Nodes) ->
|
session_drop(ClientID, kicked);
|
||||||
session_drop(ClientID, kicked)
|
false ->
|
||||||
end
|
ok
|
||||||
).
|
end.
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% Info, Stats
|
%% Info, Stats
|
||||||
|
|
|
@ -376,6 +376,7 @@ kickout_clients(ClientIds) when is_list(ClientIds) ->
|
||||||
emqx_management_proto_v5:kickout_clients(Node, ClientIds)
|
emqx_management_proto_v5:kickout_clients(Node, ClientIds)
|
||||||
end,
|
end,
|
||||||
Results = lists:map(F, emqx:running_nodes()),
|
Results = lists:map(F, emqx:running_nodes()),
|
||||||
|
lists:foreach(fun emqx_persistent_session_ds:kick_offline_session/1, ClientIds),
|
||||||
case lists:filter(fun(Res) -> Res =/= ok end, Results) of
|
case lists:filter(fun(Res) -> Res =/= ok end, Results) of
|
||||||
[] ->
|
[] ->
|
||||||
ok;
|
ok;
|
||||||
|
|
Loading…
Reference in New Issue