[PATCH b4 v2 04/44] review: use the same busy timeout for both review databases

Christian Brauner <[email protected]> Fri, 31 Jul 2026 23:58:45 +0200
Newsgroups org.kernel.linux.tools
Message-ID <20260731-work-b4-editor-branch-guard-v2-4-243fd19d322d@kernel.org>
The messages database uses a 5s busy timeout, the tracking database
next to it 15s, with the same two writers. There is no reason for them
to differ. Use the same value for both.

Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
 src/b4/review/messages.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/b4/review/messages.py b/src/b4/review/messages.py
index a3a2d53..a73e986 100644
--- a/src/b4/review/messages.py
+++ b/src/b4/review/messages.py
@@ -44,8 +44,9 @@ def get_db() -> sqlite3.Connection:
     is_new = not os.path.exists(db_path)
     conn = sqlite3.connect(db_path)
     conn.row_factory = sqlite3.Row
-    # Both the TUI and 'b4 review cron' may write concurrently
-    conn.execute('PRAGMA busy_timeout = 5000')
+    # Both the TUI and 'b4 review cron' may write concurrently; same
+    # generous timeout the tracking database uses, for the same reason
+    conn.execute('PRAGMA busy_timeout = 15000')
     if is_new:
         conn.executescript(SCHEMA_SQL)
         conn.execute(

-- 
2.53.0