diff --git a/synapse/Cargo.toml b/synapse/Cargo.toml index 2e7b25c..e626228 100644 --- a/synapse/Cargo.toml +++ b/synapse/Cargo.toml @@ -20,6 +20,7 @@ http-body = "0.4.5" humantime = "2.1.0" humantime-serde = "1.1.1" pyo3 = { version = "0.17.2", features = ["extension-module", "abi3-py37", "anyhow"] } +pyo3-asyncio = "0.17.0" pyo3-log = "0.7.0" pyo3-matrix-synapse-module = "0.1.1" serde = { version = "1.0.145", features = ["derive"] } diff --git a/synapse/src/lib.rs b/synapse/src/lib.rs index 80679fd..9f61b97 100644 --- a/synapse/src/lib.rs +++ b/synapse/src/lib.rs @@ -76,7 +76,7 @@ impl SynapseRendezvousModule { .context("Could not convert max_bytes from config")?; let sessions = matrix_http_rendezvous::Sessions::new(config.ttl, config.max_entries); - tokio::spawn(sessions.eviction_task(Duration::from_secs(60))); + pyo3_asyncio::tokio::get_runtime().spawn(sessions.eviction_task(Duration::from_secs(60))); let service = matrix_http_rendezvous::router(&config.prefix, sessions, max_bytes) .map_response(|res| res.map(|b| b.map_err(|e| anyhow!(e))));