From f376aa80726bc122460de6f4da55efef14e63021 Mon Sep 17 00:00:00 2001 From: Serge Tupchii Date: Mon, 11 Mar 2024 10:39:09 +0200 Subject: [PATCH] refactor(emqx_mgmt_api_clients): remove unnecessary function --- .../src/emqx_mgmt_api_clients.erl | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/apps/emqx_management/src/emqx_mgmt_api_clients.erl b/apps/emqx_management/src/emqx_mgmt_api_clients.erl index 98a6d64d5..cf80f7e73 100644 --- a/apps/emqx_management/src/emqx_mgmt_api_clients.erl +++ b/apps/emqx_management/src/emqx_mgmt_api_clients.erl @@ -1135,7 +1135,7 @@ remove_live_sessions(Rows) -> ). list_client_msgs(MsgType, ClientID, QString) -> - case parse_cont_pager_params(QString, MsgType) of + case emqx_mgmt_api:parse_cont_pager_params(QString, cont_encoding(MsgType)) of false -> {400, #{code => <<"INVALID_PARAMETER">>, message => <<"after_limit_invalid">>}}; PagerParams = #{} -> @@ -1147,24 +1147,6 @@ list_client_msgs(MsgType, ClientID, QString) -> end end. -parse_cont_pager_params(QString, MsgType) -> - case emqx_mgmt_api:parse_cont_pager_params(QString, cont_encoding(MsgType)) of - false -> - false; - PagerParams -> - maybe_cast_cont(MsgType, PagerParams) - end. - -maybe_cast_cont(inflight_msgs, #{continuation := Cont} = PagerParams) when is_binary(Cont) -> - try - PagerParams#{continuation => emqx_utils_conv:int(Cont)} - catch - _:_ -> - false - end; -maybe_cast_cont(_, PagerParams) -> - PagerParams. - %% integer packet id cont_encoding(inflight_msgs) -> ?URL_PARAM_INTEGER; %% binary message id