Skip to content

Commit

Permalink
Spawn the eviction task in the right runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Oct 14, 2022
1 parent 4e9f3e3 commit 9aaf13b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions synapse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion synapse/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
Expand Down

0 comments on commit 9aaf13b

Please sign in to comment.