diff --git a/crates/vectorless-py/src/engine.rs b/crates/vectorless-py/src/engine.rs index 065af2f..0d04b25 100644 --- a/crates/vectorless-py/src/engine.rs +++ b/crates/vectorless-py/src/engine.rs @@ -5,9 +5,8 @@ use pyo3::exceptions::PyRuntimeError; use pyo3::prelude::*; -use pyo3_async_runtimes::tokio::future_into_py; +use pyo3_async_runtimes::tokio::{future_into_py, get_runtime}; use std::sync::Arc; -use tokio::runtime::Runtime; use ::vectorless_engine::{Engine, EngineBuilder, IngestInput, RawNodeInput}; @@ -142,9 +141,7 @@ impl PyEngine { endpoint: Option, config: Option>, ) -> PyResult { - let rt = Runtime::new().map_err(|e| { - PyRuntimeError::new_err(format!("Failed to create tokio runtime: {}", e)) - })?; + let rt = get_runtime(); let rust_config = config.map(|c| c.inner.clone());