Skip to content

Commit

Permalink
khepri_machine: Call process_query1/3 directly in `add_applied_cond…
Browse files Browse the repository at this point in the history
…ition1/3`

[Why]
There is no need to run the same checks as a user query. We can execute
the query directly.
  • Loading branch information
dumbbell committed Aug 13, 2024
1 parent 669b193 commit 7033ded
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/khepri_machine.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1022,9 +1022,7 @@ add_applied_condition1(StoreId, Options, Timeout) ->
%% follower and handle the redirect to the leader.
T0 = khepri_utils:start_timeout_window(Timeout),
QueryFun = fun erlang:is_tuple/1,
InternalOptions = #{favor => low_latency,
timeout => Timeout},
case process_query(StoreId, QueryFun, InternalOptions) of
case process_query1(StoreId, QueryFun, Timeout) of
true ->
NewTimeout = khepri_utils:end_timeout_window(Timeout, T0),
add_applied_condition2(StoreId, Options, NewTimeout);
Expand Down

0 comments on commit 7033ded

Please sign in to comment.