feat(queue): fix static check issues

This commit is contained in:
Ilya Averyanov 2024-06-28 20:30:26 +03:00
parent 7658e081c5
commit 9bde981c44
7 changed files with 11 additions and 8 deletions

View File

@ -27,6 +27,7 @@
{emqx_ds,2}. {emqx_ds,2}.
{emqx_ds,3}. {emqx_ds,3}.
{emqx_ds,4}. {emqx_ds,4}.
{emqx_ds_shared_sub,1}.
{emqx_eviction_agent,1}. {emqx_eviction_agent,1}.
{emqx_eviction_agent,2}. {emqx_eviction_agent,2}.
{emqx_eviction_agent,3}. {emqx_eviction_agent,3}.

View File

@ -364,7 +364,7 @@ agent_opts(#{session_id := SessionId}) ->
now_ms() -> now_ms() ->
erlang:system_time(millisecond). erlang:system_time(millisecond).
is_use_finished(S, #srs{unsubscribed = Unsubscribed}) -> is_use_finished(_S, #srs{unsubscribed = Unsubscribed}) ->
Unsubscribed. Unsubscribed.
is_stream_fully_acked(S, SRS) -> is_stream_fully_acked(S, SRS) ->

View File

@ -14,7 +14,7 @@
on_unsubscribe/2, on_unsubscribe/2,
on_stream_progress/2, on_stream_progress/2,
on_info/2, on_info/2,
on_disconnect/1, on_disconnect/2,
renew_streams/1 renew_streams/1
]). ]).
@ -37,7 +37,7 @@ on_subscribe(_Agent, _TopicFilter, _SubOpts) ->
on_unsubscribe(Agent, _TopicFilter) -> on_unsubscribe(Agent, _TopicFilter) ->
Agent. Agent.
on_disconnect(Agent) -> on_disconnect(Agent, _) ->
Agent. Agent.
renew_streams(Agent) -> renew_streams(Agent) ->

View File

@ -372,7 +372,7 @@ handle_leader_renew_stream_lease(GSM, VersionOld, VersionNew) ->
%% Unexpected versions or state %% Unexpected versions or state
transition(GSM, ?connecting, #{}). transition(GSM, ?connecting, #{}).
-spec handle_stream_progress(group_sm(), emqx_ds_shared_sub_proto:agent_stream_progress()) -> -spec handle_stream_progress(group_sm(), list(emqx_ds_shared_sub_proto:agent_stream_progress())) ->
group_sm(). group_sm().
handle_stream_progress(#{state := ?connecting} = GSM, _StreamProgresses) -> handle_stream_progress(#{state := ?connecting} = GSM, _StreamProgresses) ->
GSM; GSM;

View File

@ -40,7 +40,7 @@
-type agent_state() :: #{ -type agent_state() :: #{
%% Our view of group gm's status %% Our view of group gm's status
%% it lags the actual state %% it lags the actual state
state := emqx_ds_shared_sub_agent:status(), state := ?waiting_replaying | ?replaying | ?waiting_updating | ?updating,
prev_version := emqx_maybe:t(emqx_ds_shared_sub_proto:version()), prev_version := emqx_maybe:t(emqx_ds_shared_sub_proto:version()),
version := emqx_ds_shared_sub_proto:version(), version := emqx_ds_shared_sub_proto:version(),
agent_metadata := emqx_ds_shared_sub_proto:agent_metadata(), agent_metadata := emqx_ds_shared_sub_proto:agent_metadata(),

View File

@ -244,8 +244,9 @@ leader_invalidate(ToAgent, OfGroup) ->
%% Internal API %% Internal API
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
agent(_Id, Pid) -> agent(Id, Pid) ->
?agent(_Id, Pid). _ = Id,
?agent(Id, Pid).
format_streams(Streams) -> format_streams(Streams) ->
lists:map( lists:map(

View File

@ -14,6 +14,7 @@
agent_connect_leader/5, agent_connect_leader/5,
agent_update_stream_states/5, agent_update_stream_states/5,
agent_update_stream_states/6, agent_update_stream_states/6,
agent_disconnect/5,
leader_lease_streams/6, leader_lease_streams/6,
leader_renew_stream_lease/4, leader_renew_stream_lease/4,
@ -30,7 +31,7 @@ introduced_in() ->
emqx_ds_shared_sub_proto:leader(), emqx_ds_shared_sub_proto:leader(),
emqx_ds_shared_sub_proto:agent(), emqx_ds_shared_sub_proto:agent(),
emqx_ds_shared_sub_proto:agent_metadata(), emqx_ds_shared_sub_proto:agent_metadata(),
emqx_ds_shared_sub_proto:topic_filter() emqx_persistent_session_ds:share_topic_filter()
) -> ok. ) -> ok.
agent_connect_leader(Node, ToLeader, FromAgent, AgentMetadata, TopicFilter) -> agent_connect_leader(Node, ToLeader, FromAgent, AgentMetadata, TopicFilter) ->
erpc:cast(Node, emqx_ds_shared_sub_proto, agent_connect_leader, [ erpc:cast(Node, emqx_ds_shared_sub_proto, agent_connect_leader, [