diff --git a/agent-office/app/db.py b/agent-office/app/db.py index 392d087..81f95d7 100644 --- a/agent-office/app/db.py +++ b/agent-office/app/db.py @@ -9,9 +9,10 @@ from .config import DB_PATH def _conn() -> sqlite3.Connection: os.makedirs(os.path.dirname(DB_PATH), exist_ok=True) - conn = sqlite3.connect(DB_PATH, timeout=10) + conn = sqlite3.connect(DB_PATH, timeout=120.0) conn.row_factory = sqlite3.Row conn.execute("PRAGMA journal_mode=WAL") + conn.execute("PRAGMA busy_timeout=120000") return conn diff --git a/blog-lab/app/db.py b/blog-lab/app/db.py index 79e1ab5..a531ad0 100644 --- a/blog-lab/app/db.py +++ b/blog-lab/app/db.py @@ -8,9 +8,10 @@ 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=120.0) conn.row_factory = sqlite3.Row conn.execute("PRAGMA journal_mode=WAL") + conn.execute("PRAGMA busy_timeout=120000") return conn diff --git a/lotto/app/db.py b/lotto/app/db.py index 32bae14..ae9f678 100644 --- a/lotto/app/db.py +++ b/lotto/app/db.py @@ -9,8 +9,10 @@ DB_PATH = "/app/data/lotto.db" 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=120.0) conn.row_factory = sqlite3.Row + conn.execute("PRAGMA journal_mode=WAL") + conn.execute("PRAGMA busy_timeout=120000") return conn def _ensure_column(conn: sqlite3.Connection, table: str, col: str, ddl: str) -> None: diff --git a/music-lab/app/db.py b/music-lab/app/db.py index 06b4077..45fa4c5 100644 --- a/music-lab/app/db.py +++ b/music-lab/app/db.py @@ -9,8 +9,10 @@ DB_PATH = "/app/data/music.db" 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=120.0) conn.row_factory = sqlite3.Row + conn.execute("PRAGMA journal_mode=WAL") + conn.execute("PRAGMA busy_timeout=120000") return conn diff --git a/personal/app/db.py b/personal/app/db.py index c91e5d7..a712223 100644 --- a/personal/app/db.py +++ b/personal/app/db.py @@ -9,9 +9,10 @@ DB_PATH = "/app/data/personal.db" def _conn(): - c = sqlite3.connect(DB_PATH, timeout=10) + c = sqlite3.connect(DB_PATH, timeout=120.0) c.row_factory = sqlite3.Row c.execute("PRAGMA journal_mode=WAL;") + c.execute("PRAGMA busy_timeout=120000;") c.execute("PRAGMA foreign_keys=ON;") return c diff --git a/realestate-lab/app/db.py b/realestate-lab/app/db.py index f3c41fc..d795b48 100644 --- a/realestate-lab/app/db.py +++ b/realestate-lab/app/db.py @@ -12,9 +12,10 @@ DB_PATH = os.getenv("REALESTATE_DB_PATH", "/app/data/realestate.db") def _conn(): - c = sqlite3.connect(DB_PATH, timeout=10) + c = sqlite3.connect(DB_PATH, timeout=120.0) c.row_factory = sqlite3.Row c.execute("PRAGMA journal_mode=WAL;") + c.execute("PRAGMA busy_timeout=120000;") c.execute("PRAGMA foreign_keys=ON;") return c diff --git a/stock-lab/app/db.py b/stock-lab/app/db.py index 4183a10..bfb50bf 100644 --- a/stock-lab/app/db.py +++ b/stock-lab/app/db.py @@ -12,8 +12,10 @@ def _conn() -> sqlite3.Connection: parent = os.path.dirname(db_path) if parent: os.makedirs(parent, exist_ok=True) - conn = sqlite3.connect(db_path) + conn = sqlite3.connect(db_path, timeout=120.0) conn.row_factory = sqlite3.Row + conn.execute("PRAGMA journal_mode=WAL") + conn.execute("PRAGMA busy_timeout=120000") return conn def init_db(): diff --git a/travel-proxy/app/db.py b/travel-proxy/app/db.py index 48d0462..9451d68 100644 --- a/travel-proxy/app/db.py +++ b/travel-proxy/app/db.py @@ -7,9 +7,10 @@ DB_PATH = os.getenv("TRAVEL_DB_PATH", "/data/thumbs/travel.db") 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=120.0) conn.row_factory = sqlite3.Row conn.execute("PRAGMA journal_mode=WAL") + conn.execute("PRAGMA busy_timeout=120000") return conn