about summary refs log tree commit diff
path: root/tvix/store/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src')
-rw-r--r--tvix/store/src/bin/tvix-store.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs
index dbd9e2986e24..8966be211fb2 100644
--- a/tvix/store/src/bin/tvix-store.rs
+++ b/tvix/store/src/bin/tvix-store.rs
@@ -128,17 +128,21 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
                 directory_service.clone(),
             );
 
-            let mut io = TvixStoreIO::new(
-                blob_service,
-                directory_service,
-                path_info_service,
-                nar_calculation_service,
-            );
-
             for path in paths {
-                let path_info = io
-                    .import_path_with_pathinfo(&path)
-                    .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?;
+                let path_move = path.clone();
+
+                let mut io = TvixStoreIO::new(
+                    blob_service.clone(),
+                    directory_service.clone(),
+                    path_info_service.clone(),
+                    nar_calculation_service.clone(),
+                );
+
+                let path_info = tokio::task::spawn_blocking(move || {
+                    io.import_path_with_pathinfo(&path_move)
+                        .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
+                })
+                .await??;
 
                 match path_info.node.unwrap().node.unwrap() {
                     tvix_store::proto::node::Node::Directory(directory_node) => {