Skip to content

Commit

Permalink
Merge pull request #451 from rabbitmq/emit-new-local_query-tuple-only…
Browse files Browse the repository at this point in the history
…-if-options-are-set

Emit the new `local_query` tuple only if query options are set
  • Loading branch information
michaelklishin authored Jul 8, 2024
2 parents c4bd628 + 26b0259 commit a5d8e3b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ra_server_proc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,14 @@ cast_command(ServerId, Priority, Cmd) ->
ra_server_proc:ra_leader_call_ret({ra_idxterm(), Reply :: term()})
| ra_server_proc:ra_leader_call_ret(Reply :: term())
| {ok, {ra_idxterm(), Reply :: term()}, not_known}.
query(ServerLoc, QueryFun, local, Options, Timeout)
when map_size(Options) =:= 0 ->
statem_call(ServerLoc, {local_query, QueryFun}, Timeout);
query(ServerLoc, QueryFun, local, Options, Timeout) ->
statem_call(ServerLoc, {local_query, QueryFun, Options}, Timeout);
query(ServerLoc, QueryFun, leader, Options, Timeout)
when map_size(Options) =:= 0 ->
leader_call(ServerLoc, {local_query, QueryFun}, Timeout);
query(ServerLoc, QueryFun, leader, Options, Timeout) ->
leader_call(ServerLoc, {local_query, QueryFun, Options}, Timeout);
query(ServerLoc, QueryFun, consistent, _Options, Timeout) ->
Expand Down

0 comments on commit a5d8e3b

Please sign in to comment.