about summary refs log tree commit diff
path: root/tvix/store/src
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-31T14·13+0200
committerclbot <clbot@tvl.fyi>2023-12-31T22·18+0000
commit9ca1353122e6c1c5cf88d2ed5839fe385be1d5d0 (patch)
tree010bc4ec556a7e9e109cc0f74051363187d68f76 /tvix/store/src
parente2b6c77bfc4d00ba275d8029fe333d6064c268e9 (diff)
refactor(tvix/castore/blobsvc): return Box, not Arc r/7293
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 <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src')
-rw-r--r--tvix/store/src/bin/tvix-store.rs13
1 files changed, 9 insertions, 4 deletions
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<dyn std::error::Error>> {
             path_info_service_addr,
         } => {
             // initialize stores
-            let blob_service = blobservice::from_addr(&blob_service_addr).await?;
+            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 path_info_service = pathinfoservice::from_addr(
                 &path_info_service_addr,
@@ -249,7 +251,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
             path_info_service_addr,
         } => {
             // FUTUREWORK: allow flat for single files?
-            let blob_service = blobservice::from_addr(&blob_service_addr).await?;
+            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 path_info_service = pathinfoservice::from_addr(
                 &path_info_service_addr,
@@ -351,7 +354,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
             list_root,
             threads,
         } => {
-            let blob_service = blobservice::from_addr(&blob_service_addr).await?;
+            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 path_info_service = pathinfoservice::from_addr(
                 &path_info_service_addr,
@@ -395,7 +399,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
             path_info_service_addr,
             list_root,
         } => {
-            let blob_service = blobservice::from_addr(&blob_service_addr).await?;
+            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 path_info_service = pathinfoservice::from_addr(
                 &path_info_service_addr,