chore(syncer): fix code style issues

Co-Authored-By: Zaiming (Stone) Shi <zmstone@gmail.com>
This commit is contained in:
Andrew Mayorov 2024-01-10 18:45:01 +01:00
parent 0b3f5f7c37
commit 498b7a922d
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 5 additions and 4 deletions

View File

@ -78,7 +78,7 @@ push(Action, Topic, Dest, Opts) ->
Worker = gproc_pool:pick_worker(?POOL, Topic), Worker = gproc_pool:pick_worker(?POOL, Topic),
Prio = designate_prio(Action, Opts), Prio = designate_prio(Action, Opts),
Context = mk_push_context(Opts), Context = mk_push_context(Opts),
Worker ! ?PUSH(Prio, {Action, Topic, Dest, Context}), _ = erlang:send(Worker, ?PUSH(Prio, {Action, Topic, Dest, Context})),
case Context of case Context of
{MRef, _} -> {MRef, _} ->
MRef; MRef;
@ -148,7 +148,7 @@ run_batch_loop(Incoming, State = #{stash := Stash0}) ->
ok = send_replies(Errors, Batch), ok = send_replies(Errors, Batch),
NState = State#{stash := Stash3}, NState = State#{stash := Stash3},
%% TODO: postpone if only ?PRIO_BG operations left? %% TODO: postpone if only ?PRIO_BG operations left?
case stash_empty(Stash3) of case is_stash_empty(Stash3) of
true -> true ->
NState; NState;
false -> false ->
@ -209,7 +209,8 @@ send_replies(Errors, Batch) ->
replyctx_send(_Result, []) -> replyctx_send(_Result, []) ->
noreply; noreply;
replyctx_send(Result, {MRef, Pid}) -> replyctx_send(Result, {MRef, Pid}) ->
Pid ! {MRef, Result}. _ = erlang:send(Pid, {MRef, Result}),
ok.
%% %%
@ -221,7 +222,7 @@ run_batch(Batch) ->
stash_new() -> stash_new() ->
#{}. #{}.
stash_empty(Stash) -> is_stash_empty(Stash) ->
maps:size(Stash) =:= 0. maps:size(Stash) =:= 0.
stash_drain(Stash) -> stash_drain(Stash) ->