Skip to content

Commit ea2e116

Browse files
committed
TRY SPAWN
1 parent a8ba4ed commit ea2e116

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/io/vss_store.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ impl KVStoreSync for VssStore {
120120
let inner = Arc::clone(&self.inner);
121121
let fut =
122122
async move { inner.read_internal(primary_namespace, secondary_namespace, key).await };
123-
tokio::task::block_in_place(move || internal_runtime.block_on(fut))
123+
let spawned_fut = internal_runtime.spawn(fut);
124+
tokio::task::block_in_place(move || internal_runtime.block_on(spawned_fut)).unwrap()
124125
}
125126

126127
fn write(
@@ -150,7 +151,8 @@ impl KVStoreSync for VssStore {
150151
)
151152
.await
152153
};
153-
tokio::task::block_in_place(move || internal_runtime.block_on(fut))
154+
let spawned_fut = internal_runtime.spawn(fut);
155+
tokio::task::block_in_place(move || internal_runtime.block_on(spawned_fut)).unwrap()
154156
}
155157

156158
fn remove(
@@ -179,7 +181,8 @@ impl KVStoreSync for VssStore {
179181
)
180182
.await
181183
};
182-
tokio::task::block_in_place(move || internal_runtime.block_on(fut))
184+
let spawned_fut = internal_runtime.spawn(fut);
185+
tokio::task::block_in_place(move || internal_runtime.block_on(spawned_fut)).unwrap()
183186
}
184187

185188
fn list(&self, primary_namespace: &str, secondary_namespace: &str) -> io::Result<Vec<String>> {
@@ -192,7 +195,8 @@ impl KVStoreSync for VssStore {
192195
let secondary_namespace = secondary_namespace.to_string();
193196
let inner = Arc::clone(&self.inner);
194197
let fut = async move { inner.list_internal(primary_namespace, secondary_namespace).await };
195-
tokio::task::block_in_place(move || internal_runtime.block_on(fut))
198+
let spawned_fut = internal_runtime.spawn(fut);
199+
tokio::task::block_in_place(move || internal_runtime.block_on(spawned_fut)).unwrap()
196200
}
197201
}
198202

0 commit comments

Comments
 (0)