diff options
author | Yureka <tvl@yuka.dev> | 2024-07-21T14·41+0200 |
---|---|---|
committer | yuka <tvl@yuka.dev> | 2024-07-22T13·36+0000 |
commit | 67335c41b7828e11d28dead8193152da94116e6d (patch) | |
tree | 045647f6b1dfc5df077286333aef26ee31f1e33f /tvix/cli | |
parent | 6774d9c59ce201864b2af05365b8a7ea2fa1066e (diff) |
refactor(tvix): move service addrs into shared clap struct r/8399
Change-Id: I7cab29ecfa1823c2103b4c47b7d784bc31459d55 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12008 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Autosubmit: yuka <yuka@yuka.dev>
Diffstat (limited to 'tvix/cli')
-rw-r--r-- | tvix/cli/src/args.rs | 11 | ||||
-rw-r--r-- | tvix/cli/src/lib.rs | 16 |
2 files changed, 6 insertions, 21 deletions
diff --git a/tvix/cli/src/args.rs b/tvix/cli/src/args.rs index ebb3c0dc107e..a4d1bcae157e 100644 --- a/tvix/cli/src/args.rs +++ b/tvix/cli/src/args.rs @@ -2,6 +2,7 @@ use std::path::PathBuf; use clap::Parser; use tracing::Level; +use tvix_store::utils::ServiceUrlsMemory; #[derive(Parser, Clone)] pub struct Args { @@ -58,14 +59,8 @@ pub struct Args { #[clap(long)] pub strict: bool, - #[arg(long, env, default_value = "memory://")] - pub blob_service_addr: String, - - #[arg(long, env, default_value = "memory://")] - pub directory_service_addr: String, - - #[arg(long, env, default_value = "memory://")] - pub path_info_service_addr: String, + #[clap(flatten)] + pub service_addrs: ServiceUrlsMemory, #[arg(long, env, default_value = "dummy://")] pub build_service_addr: String, diff --git a/tvix/cli/src/lib.rs b/tvix/cli/src/lib.rs index 070e88e358f2..7686cc2c0fe8 100644 --- a/tvix/cli/src/lib.rs +++ b/tvix/cli/src/lib.rs @@ -27,19 +27,9 @@ pub use repl::Repl; pub fn init_io_handle(tokio_runtime: &tokio::runtime::Runtime, args: &Args) -> Rc<TvixStoreIO> { let (blob_service, directory_service, path_info_service, nar_calculation_service) = tokio_runtime - .block_on({ - let blob_service_addr = args.blob_service_addr.clone(); - let directory_service_addr = args.directory_service_addr.clone(); - let path_info_service_addr = args.path_info_service_addr.clone(); - async move { - tvix_store::utils::construct_services( - blob_service_addr, - directory_service_addr, - path_info_service_addr, - ) - .await - } - }) + .block_on(tvix_store::utils::construct_services( + args.service_addrs.clone(), + )) .expect("unable to setup {blob|directory|pathinfo}service before interpreter setup"); let build_service = tokio_runtime |