Skip to content

Commit

Permalink
call the new api
Browse files Browse the repository at this point in the history
  • Loading branch information
kjnilsson committed Apr 19, 2024
1 parent 1e0dede commit 7bd50da
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/ra_server_proc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,11 @@ leader(info, {update_peer, PeerId, Update}, State0) ->
{keep_state, State, []};
leader(_, tick_timeout, State0) ->
{State1, RpcEffs} = make_rpcs(State0),
ServerState = State1#state.server_state,
Effects = ra_server:tick(ServerState),
ServerState0 = State1#state.server_state,
Effects = ra_server:tick(ServerState0),
ServerState = ra_server:log_tick(ServerState0),
{State2, Actions} = ?HANDLE_EFFECTS(RpcEffs ++ Effects ++ [{aux, tick}],
cast, State1),
cast, State1#state{server_state = ServerState}),
%% try sending any pending applied notifications again
State = send_applied_notifications(State2, #{}),
{keep_state, handle_tick_metrics(State),
Expand Down Expand Up @@ -791,8 +792,10 @@ follower(info, {node_event, Node, up}, State) ->
follower(info, {Status, Node, InfoList}, State0)
when Status =:= nodedown orelse Status =:= nodeup ->
handle_node_status_change(Node, Status, InfoList, ?FUNCTION_NAME, State0);
follower(_, tick_timeout, State0) ->
{State, Actions} = ?HANDLE_EFFECTS([{aux, tick}], cast, State0),
follower(_, tick_timeout, #state{server_state = ServerState0} = State0) ->
ServerState = ra_server:log_tick(ServerState0),
{State, Actions} = ?HANDLE_EFFECTS([{aux, tick}], cast,
State0#state{server_state = ServerState}),
{keep_state, handle_tick_metrics(State),
set_tick_timer(State, Actions)};
follower({call, From}, {log_fold, Fun, Term}, State) ->
Expand Down

0 comments on commit 7bd50da

Please sign in to comment.