From 14b4e99bc908bb0b059aa32585ca89dc47e53f2c Mon Sep 17 00:00:00 2001 From: gahusb Date: Sat, 11 Apr 2026 08:45:57 +0900 Subject: [PATCH] fix(agent-office): add sqlite timeout=10, use 'rejected' status for reject_task --- agent-office/app/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent-office/app/db.py b/agent-office/app/db.py index c22c1c4..cc5a7e1 100644 --- a/agent-office/app/db.py +++ b/agent-office/app/db.py @@ -9,7 +9,7 @@ from .config import DB_PATH def _conn() -> sqlite3.Connection: os.makedirs(os.path.dirname(DB_PATH), exist_ok=True) - conn = sqlite3.connect(DB_PATH) + conn = sqlite3.connect(DB_PATH, timeout=10) conn.row_factory = sqlite3.Row conn.execute("PRAGMA journal_mode=WAL") return conn @@ -154,7 +154,7 @@ def approve_task(task_id: str, via: str = "web") -> None: def reject_task(task_id: str) -> None: with _conn() as conn: conn.execute( - "UPDATE agent_tasks SET status='failed', completed_at=strftime('%Y-%m-%dT%H:%M:%fZ','now') WHERE id=?", + "UPDATE agent_tasks SET status='rejected', completed_at=strftime('%Y-%m-%dT%H:%M:%fZ','now') WHERE id=?", (task_id,), )