From d0e80677fcb35f31fac0f99d0f877d1a44d858fa Mon Sep 17 00:00:00 2001 From: "Willow (GHOST)" Date: Sun, 26 Jul 2026 19:00:47 +0100 Subject: [PATCH] perf(uplc): use task::spawn_blocking when adding ops to db --- uplc/src/plc.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/uplc/src/plc.rs b/uplc/src/plc.rs index 670b36a..fab4ace 100644 --- a/uplc/src/plc.rs +++ b/uplc/src/plc.rs @@ -109,7 +109,12 @@ pub async fn run_plc_sync(db: DB, stats: Arc>) -> Result<()> { total += count; stats.write().await.count_batch(&ops)?; - db.upsert_operations(ops)?; + + tokio::task::spawn_blocking({ + let db = db.clone(); + move || db.upsert_operations(ops) + }) + .await??; if count < 200 { println!("only returned {} ops, sleeping for 10 seconds", count); -- 2.51.2