mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-06 13:45:53 +01:00
Use BEGIN IMMEDIATE to avoid SQLITE_BUSY_SNAPSHOT error
Context: https://stackoverflow.com/a/57717533 Error: https://github.com/cashubtc/cdk/actions/runs/15670089048/job/44140230127?pr=822#step:6:3586
This commit is contained in:
@@ -4,7 +4,7 @@ use std::sync::{mpsc as std_mpsc, Arc, Mutex};
|
||||
use std::thread::spawn;
|
||||
use std::time::Instant;
|
||||
|
||||
use rusqlite::Connection;
|
||||
use rusqlite::{Connection, TransactionBehavior};
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
|
||||
use crate::common::SqliteConnectionManager;
|
||||
@@ -262,7 +262,7 @@ fn rusqlite_worker_manager(
|
||||
}
|
||||
};
|
||||
|
||||
let tx = match conn.transaction() {
|
||||
let tx = match conn.transaction_with_behavior(TransactionBehavior::Immediate) {
|
||||
Ok(tx) => tx,
|
||||
Err(err) => {
|
||||
tracing::error!("Failed to begin a transaction: {:?}", err);
|
||||
|
||||
Reference in New Issue
Block a user