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) ->
|
||||
session_drop(ClientID, destroy).
|
||||
|
||||
-spec kick_offline_session(emqx_types:clientid()) -> ok.
|
||||
kick_offline_session(ClientID) ->
|
||||
emqx_cm_locker:trans(
|
||||
ClientID,
|
||||
fun(_Nodes) ->
|
||||
session_drop(ClientID, kicked)
|
||||
end
|
||||
).
|
||||
case emqx_persistent_message:is_persistence_enabled() of
|
||||
true ->
|
||||
session_drop(ClientID, kicked);
|
||||
false ->
|
||||
ok
|
||||
end.
|
||||
|
||||
%%--------------------------------------------------------------------
|
||||
%% Info, Stats
|
||||
|
|
|
@ -376,6 +376,7 @@ kickout_clients(ClientIds) when is_list(ClientIds) ->
|
|||
emqx_management_proto_v5:kickout_clients(Node, ClientIds)
|
||||
end,
|
||||
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
|
||||
[] ->
|
||||
ok;
|
||||
|
|
Loading…
Reference in New Issue