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);