Fix SQLite thread error on parallel Agentic Ops API requests.
Enable check_same_thread=False for FastAPI threadpool compatibility. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6daa692af8
commit
1e8deb23ec
2 changed files with 2 additions and 2 deletions
|
|
@ -53,7 +53,7 @@ class DeskUser:
|
||||||
|
|
||||||
def db() -> sqlite3.Connection:
|
def db() -> sqlite3.Connection:
|
||||||
DB_PATH.parent.mkdir(parents=True, exist_ok=True)
|
DB_PATH.parent.mkdir(parents=True, exist_ok=True)
|
||||||
conn = sqlite3.connect(DB_PATH, timeout=30.0)
|
conn = sqlite3.connect(DB_PATH, timeout=30.0, check_same_thread=False)
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
conn.execute("PRAGMA journal_mode=WAL")
|
conn.execute("PRAGMA journal_mode=WAL")
|
||||||
conn.execute("PRAGMA busy_timeout=60000")
|
conn.execute("PRAGMA busy_timeout=60000")
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ TICKET_COLUMNS = "id,tenant_id,subject,status,payload,created_at,assigned_to,ass
|
||||||
|
|
||||||
def db():
|
def db():
|
||||||
DB_PATH.parent.mkdir(parents=True, exist_ok=True)
|
DB_PATH.parent.mkdir(parents=True, exist_ok=True)
|
||||||
conn = sqlite3.connect(DB_PATH, timeout=30.0)
|
conn = sqlite3.connect(DB_PATH, timeout=30.0, check_same_thread=False)
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
conn.execute("PRAGMA journal_mode=WAL")
|
conn.execute("PRAGMA journal_mode=WAL")
|
||||||
conn.execute("PRAGMA busy_timeout=60000")
|
conn.execute("PRAGMA busy_timeout=60000")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue