@@ -293,8 +293,7 @@ wait_for_leader(_Timeout, 0) ->
293293wait_for_leader (Timeout , Retries ) ->
294294 rabbit_log :info (" Waiting for Khepri leader for ~tp ms, ~tp retries left" ,
295295 [Timeout , Retries - 1 ]),
296- Options = #{timeout => Timeout ,
297- favor => low_latency },
296+ Options = #{timeout => Timeout },
298297 case khepri :exists (? STORE_ID , [], Options ) of
299298 Exists when is_boolean (Exists ) ->
300299 rabbit_log :info (" Khepri leader elected" ),
@@ -917,50 +916,46 @@ cas(Path, Pattern, Data) ->
917916 ? STORE_ID , Path , Pattern , Data , ? DEFAULT_COMMAND_OPTIONS ).
918917
919918fold (Path , Pred , Acc ) ->
920- khepri :fold (? STORE_ID , Path , Pred , Acc , #{ favor => low_latency } ).
919+ khepri :fold (? STORE_ID , Path , Pred , Acc ).
921920
922921fold (Path , Pred , Acc , Options ) ->
923- Options1 = Options #{favor => low_latency },
924- khepri :fold (? STORE_ID , Path , Pred , Acc , Options1 ).
922+ khepri :fold (? STORE_ID , Path , Pred , Acc , Options ).
925923
926924foreach (Path , Pred ) ->
927- khepri :foreach (? STORE_ID , Path , Pred , #{ favor => low_latency } ).
925+ khepri :foreach (? STORE_ID , Path , Pred ).
928926
929927filter (Path , Pred ) ->
930- khepri :filter (? STORE_ID , Path , Pred , #{ favor => low_latency } ).
928+ khepri :filter (? STORE_ID , Path , Pred ).
931929
932930get (Path ) ->
933- khepri :get (? STORE_ID , Path , #{ favor => low_latency } ).
931+ khepri :get (? STORE_ID , Path ).
934932
935933get (Path , Options ) ->
936- Options1 = Options #{favor => low_latency },
937- khepri :get (? STORE_ID , Path , Options1 ).
934+ khepri :get (? STORE_ID , Path , Options ).
938935
939936get_many (PathPattern ) ->
940- khepri :get_many (? STORE_ID , PathPattern , #{ favor => low_latency } ).
937+ khepri :get_many (? STORE_ID , PathPattern ).
941938
942939adv_get (Path ) ->
943- khepri_adv :get (? STORE_ID , Path , #{ favor => low_latency } ).
940+ khepri_adv :get (? STORE_ID , Path ).
944941
945942adv_get_many (PathPattern ) ->
946- khepri_adv :get_many (? STORE_ID , PathPattern , #{ favor => low_latency } ).
943+ khepri_adv :get_many (? STORE_ID , PathPattern ).
947944
948945match (Path ) ->
949946 match (Path , #{}).
950947
951948match (Path , Options ) ->
952- Options1 = Options #{favor => low_latency },
953- khepri :get_many (? STORE_ID , Path , Options1 ).
949+ khepri :get_many (? STORE_ID , Path , Options ).
954950
955- exists (Path ) -> khepri :exists (? STORE_ID , Path , #{ favor => low_latency } ).
951+ exists (Path ) -> khepri :exists (? STORE_ID , Path ).
956952
957953list (Path ) ->
958954 khepri :get_many (
959- ? STORE_ID , Path ++ [? KHEPRI_WILDCARD_STAR ], #{ favor => low_latency } ).
955+ ? STORE_ID , Path ++ [? KHEPRI_WILDCARD_STAR ]).
960956
961957list_child_nodes (Path ) ->
962- Options = #{props_to_return => [child_names ],
963- favor => low_latency },
958+ Options = #{props_to_return => [child_names ]},
964959 case khepri_adv :get_many (? STORE_ID , Path , Options ) of
965960 {ok , Result } ->
966961 case maps :values (Result ) of
@@ -974,8 +969,7 @@ list_child_nodes(Path) ->
974969 end .
975970
976971count_children (Path ) ->
977- Options = #{props_to_return => [child_list_length ],
978- favor => low_latency },
972+ Options = #{props_to_return => [child_list_length ]},
979973 case khepri_adv :get_many (? STORE_ID , Path , Options ) of
980974 {ok , Map } ->
981975 lists :sum ([L || #{child_list_length := L } <- maps :values (Map )]);
@@ -1026,18 +1020,9 @@ transaction(Fun) ->
10261020transaction (Fun , ReadWrite ) ->
10271021 transaction (Fun , ReadWrite , #{}).
10281022
1029- transaction (Fun , ReadWrite , Options0 ) ->
1030- % % If the transaction is read-only, use the same default options we use
1031- % % for most queries.
1032- DefaultQueryOptions = case ReadWrite of
1033- ro ->
1034- #{favor => low_latency };
1035- _ ->
1036- #{}
1037- end ,
1038- Options1 = maps :merge (DefaultQueryOptions , Options0 ),
1039- Options = maps :merge (? DEFAULT_COMMAND_OPTIONS , Options1 ),
1040- case khepri :transaction (? STORE_ID , Fun , ReadWrite , Options ) of
1023+ transaction (Fun , ReadWrite , Options ) ->
1024+ Options1 = maps :merge (? DEFAULT_COMMAND_OPTIONS , Options ),
1025+ case khepri :transaction (? STORE_ID , Fun , ReadWrite , Options1 ) of
10411026 ok -> ok ;
10421027 {ok , Result } -> Result ;
10431028 {error , Reason } -> throw ({error , Reason })
0 commit comments