diff --git a/src/bin_proxy_server/main_proxy_server.ml b/src/bin_proxy_server/main_proxy_server.ml index 47b4418312eaeed5f13bc7fc73c6f6ae585048f0..7bb2f8cbd1996276a661cd9e2ad02244a26356d9 100644 --- a/src/bin_proxy_server/main_proxy_server.ml +++ b/src/bin_proxy_server/main_proxy_server.ml @@ -32,7 +32,7 @@ let config : string option Term.t = let doc = "The configuration file. Fields (see corresponding options): endpoint \ (string), rpc_addr (string), rpc_tls (string), sym_block_caching_time \ - (int), and data_dir (string)." + (Ptime.span), and data_dir (string)." in let docv = "CONFIG" in Arg.(value & opt (some string) None & info ["c"; "config"] ~docv ~doc) @@ -70,7 +70,7 @@ let data_dir : string option Term.t = let docv = "DATA_DIR" in Arg.(value & opt (some string) None & info ["d"; "data-dir"] ~docv ~doc) -let sym_block_caching_time : int option Term.t = +let sym_block_caching_time : Ptime.span option Term.t = let doc = "The duration (in seconds) during which data for a symbolic block \ identifier (like head) is kept. Smaller values increase the endpoint's \ @@ -79,7 +79,7 @@ let sym_block_caching_time : int option Term.t = this value)." in let docv = "SYM_BLOCK_CACHING_TIME" in - Arg.(value & opt (some int) None & info ["sym-block-caching-time"] ~docv ~doc) + Arg.(value & opt (some Ptime.span conv) None & info ["sym-block-caching-time"] ~docv ~doc) let load_config_from_file (config_file : string) = let open Lwt_result_syntax in diff --git a/src/lib_proxy/proxy_services.ml b/src/lib_proxy/proxy_services.ml index 00e4fcdc6f9c6dc29283b7a0ff30e4cb34219045..06f69a042390b98689c4e4edbc0c185bc7f6e7d7 100644 --- a/src/lib_proxy/proxy_services.ml +++ b/src/lib_proxy/proxy_services.ml @@ -118,7 +118,7 @@ type mode = | Proxy_client | Proxy_server of { sleep : float -> unit Lwt.t; - sym_block_caching_time : int option; + sym_block_caching_time : Ptime.span option; on_disk_proxy_builder : (Context_hash.t -> Proxy_delegate.t tzresult Lwt.t) option; } @@ -191,7 +191,7 @@ let schedule_clearing (printer : Tezos_client_base.Client_context.printer) let* time_between_blocks = match sym_block_caching_time with | Some sym_block_caching_time -> - Lwt.return @@ Int.to_float sym_block_caching_time + Lwt.return @@ Ptime.Span.to_float_s sym_block_caching_time | None -> ( let (module Proxy_environment) = proxy_env in let* ro = diff --git a/src/lib_proxy/proxy_services.mli b/src/lib_proxy/proxy_services.mli index 566aab94694ece25df15012780456d818e127c68..6c893c59d71e743ec8981410d03347fad1498fb1 100644 --- a/src/lib_proxy/proxy_services.mli +++ b/src/lib_proxy/proxy_services.mli @@ -40,7 +40,7 @@ type mode = | Proxy_client (** [tezos-client --mode proxy] is running *) | Proxy_server of { sleep : float -> unit Lwt.t; - sym_block_caching_time : int option; + sym_block_caching_time : Ptime.span option; on_disk_proxy_builder : (Context_hash.t -> Proxy_delegate.t tzresult Lwt.t) option; }