fix: spawn js service task on blocking pool (#4180)

This commit is contained in:
Matthias Seitz
2023-08-14 11:23:48 +02:00
committed by GitHub
parent c9bb6216cd
commit d0b687b312

View File

@@ -538,7 +538,9 @@ where
let (to_db_service, rx) = mpsc::channel(1);
let (ready_tx, ready_rx) = std::sync::mpsc::channel();
let this = self.clone();
self.inner.task_spawner.spawn(Box::pin(async move {
// this needs to be on a blocking task because it only does blocking work besides waiting
// for db requests
self.inner.task_spawner.spawn_blocking(Box::pin(async move {
this.js_trace_db_service_task(at, rx, ready_tx, db).await
}));
// wait for initialization