Skip to content

Commit 9aaf13b

Browse files
committed
Spawn the eviction task in the right runtime
1 parent 4e9f3e3 commit 9aaf13b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

synapse/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ http-body = "0.4.5"
2020
humantime = "2.1.0"
2121
humantime-serde = "1.1.1"
2222
pyo3 = { version = "0.17.2", features = ["extension-module", "abi3-py37", "anyhow"] }
23+
pyo3-asyncio = "0.17.0"
2324
pyo3-log = "0.7.0"
2425
pyo3-matrix-synapse-module = "0.1.1"
2526
serde = { version = "1.0.145", features = ["derive"] }

synapse/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl SynapseRendezvousModule {
7676
.context("Could not convert max_bytes from config")?;
7777

7878
let sessions = matrix_http_rendezvous::Sessions::new(config.ttl, config.max_entries);
79-
tokio::spawn(sessions.eviction_task(Duration::from_secs(60)));
79+
pyo3_asyncio::tokio::get_runtime().spawn(sessions.eviction_task(Duration::from_secs(60)));
8080

8181
let service = matrix_http_rendezvous::router(&config.prefix, sessions, max_bytes)
8282
.map_response(|res| res.map(|b| b.map_err(|e| anyhow!(e))));

0 commit comments

Comments
 (0)