From 9ca1353122e6c1c5cf88d2ed5839fe385be1d5d0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 31 Dec 2023 16:13:29 +0200 Subject: refactor(tvix/castore/blobsvc): return Box, not Arc While we currently mostly use it in an Arc, as we need to clone it inside PathInfoService, there might be other usecases not requiring it to be Clone. Change-Id: I7bd337cd2e4c2d4154b385461eefa62c9b78345d Reviewed-on: https://cl.tvl.fyi/c/depot/+/10482 Autosubmit: flokli Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/store/src/bin/tvix-store.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tvix/store/src') diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs index 3efe6c098274..d00d5e304776 100644 --- a/tvix/store/src/bin/tvix-store.rs +++ b/tvix/store/src/bin/tvix-store.rs @@ -12,6 +12,7 @@ use tokio_listener::SystemOptions; use tokio_listener::UserOptions; use tracing_subscriber::prelude::*; use tvix_castore::blobservice; +use tvix_castore::blobservice::BlobService; use tvix_castore::directoryservice; use tvix_castore::import; use tvix_castore::proto::blob_service_server::BlobServiceServer; @@ -194,7 +195,8 @@ async fn main() -> Result<(), Box> { path_info_service_addr, } => { // initialize stores - let blob_service = blobservice::from_addr(&blob_service_addr).await?; + let blob_service: Arc = + blobservice::from_addr(&blob_service_addr).await?.into(); let directory_service = directoryservice::from_addr(&directory_service_addr).await?; let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, @@ -249,7 +251,8 @@ async fn main() -> Result<(), Box> { path_info_service_addr, } => { // FUTUREWORK: allow flat for single files? - let blob_service = blobservice::from_addr(&blob_service_addr).await?; + let blob_service: Arc = + blobservice::from_addr(&blob_service_addr).await?.into(); let directory_service = directoryservice::from_addr(&directory_service_addr).await?; let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, @@ -351,7 +354,8 @@ async fn main() -> Result<(), Box> { list_root, threads, } => { - let blob_service = blobservice::from_addr(&blob_service_addr).await?; + let blob_service: Arc = + blobservice::from_addr(&blob_service_addr).await?.into(); let directory_service = directoryservice::from_addr(&directory_service_addr).await?; let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, @@ -395,7 +399,8 @@ async fn main() -> Result<(), Box> { path_info_service_addr, list_root, } => { - let blob_service = blobservice::from_addr(&blob_service_addr).await?; + let blob_service: Arc = + blobservice::from_addr(&blob_service_addr).await?.into(); let directory_service = directoryservice::from_addr(&directory_service_addr).await?; let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, -- cgit 1.4.1