about summary refs log tree commit diff
path: root/tvix/glue/src/builtins/import.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-03-28T21·05+0100
committerflokli <flokli@flokli.de>2024-03-28T21·17+0000
commit156a5a0fb6eeb231431a86f8d53f3ef50816c03d (patch)
tree6481d3a2a599f266a421ce70100c2ae32a6805e7 /tvix/glue/src/builtins/import.rs
parentbd32024047f4977b95ae9c04c1f7b2ad3b103a91 (diff)
refactor(tvix/glue): drop ingest_entries_sync r/7800
Make this function async, and do the block_on on the (single) callsite.

Change-Id: Ib8b0b54ab5370fe02ef95f38a45d8866868a9d60
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11285
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/glue/src/builtins/import.rs')
-rw-r--r--tvix/glue/src/builtins/import.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/tvix/glue/src/builtins/import.rs b/tvix/glue/src/builtins/import.rs
index 50b99690eefd..88e483031f46 100644
--- a/tvix/glue/src/builtins/import.rs
+++ b/tvix/glue/src/builtins/import.rs
@@ -102,12 +102,15 @@ async fn filtered_ingest(
 
     pin_mut!(entries_stream);
 
-    state
-        .ingest_entries_sync(entries_stream)
-        .map_err(|err| ErrorKind::IO {
-            path: Some(path.to_path_buf()),
-            error: err.into(),
-        })
+    state.tokio_handle.block_on(async {
+        state
+            .ingest_entries(entries_stream)
+            .await
+            .map_err(|err| ErrorKind::IO {
+                path: Some(path.to_path_buf()),
+                error: err.into(),
+            })
+    })
 }
 
 #[builtins(state = "Rc<TvixStoreIO>")]