diff options
author | Florian Klink <flokli@flokli.de> | 2023-12-31T14·26+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-31T22·18+0000 |
commit | 41935fab702f534ce7b787ef5f6e9f2ac2e7ce00 (patch) | |
tree | f71a64a30f20dd7eef4ddc5f3ee1a26983236a51 /tvix/store/src/bin/tvix-store.rs | |
parent | 9ca1353122e6c1c5cf88d2ed5839fe385be1d5d0 (diff) |
refactor(tvix/castore/directorysvc): return Box, not Arc r/7294
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: Ia05bb370340792a048e2036be30e285ef1e63870 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10483 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/bin/tvix-store.rs')
-rw-r--r-- | tvix/store/src/bin/tvix-store.rs | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs index d00d5e304776..912417af8146 100644 --- a/tvix/store/src/bin/tvix-store.rs +++ b/tvix/store/src/bin/tvix-store.rs @@ -14,6 +14,7 @@ use tracing_subscriber::prelude::*; use tvix_castore::blobservice; use tvix_castore::blobservice::BlobService; use tvix_castore::directoryservice; +use tvix_castore::directoryservice::DirectoryService; use tvix_castore::import; use tvix_castore::proto::blob_service_server::BlobServiceServer; use tvix_castore::proto::directory_service_server::DirectoryServiceServer; @@ -197,7 +198,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { // initialize stores let blob_service: Arc<dyn BlobService> = blobservice::from_addr(&blob_service_addr).await?.into(); - let directory_service = directoryservice::from_addr(&directory_service_addr).await?; + let directory_service: Arc<dyn DirectoryService> = + directoryservice::from_addr(&directory_service_addr) + .await? + .into(); let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, blob_service.clone(), @@ -253,7 +257,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { // FUTUREWORK: allow flat for single files? let blob_service: Arc<dyn BlobService> = blobservice::from_addr(&blob_service_addr).await?.into(); - let directory_service = directoryservice::from_addr(&directory_service_addr).await?; + let directory_service: Arc<dyn DirectoryService> = + directoryservice::from_addr(&directory_service_addr) + .await? + .into(); let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, blob_service.clone(), @@ -356,7 +363,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { } => { let blob_service: Arc<dyn BlobService> = blobservice::from_addr(&blob_service_addr).await?.into(); - let directory_service = directoryservice::from_addr(&directory_service_addr).await?; + let directory_service: Arc<dyn DirectoryService> = + directoryservice::from_addr(&directory_service_addr) + .await? + .into(); let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, blob_service.clone(), @@ -401,7 +411,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { } => { let blob_service: Arc<dyn BlobService> = blobservice::from_addr(&blob_service_addr).await?.into(); - let directory_service = directoryservice::from_addr(&directory_service_addr).await?; + let directory_service: Arc<dyn DirectoryService> = + directoryservice::from_addr(&directory_service_addr) + .await? + .into(); let path_info_service = pathinfoservice::from_addr( &path_info_service_addr, blob_service.clone(), |