Skip to content

Commit 09b9899

Browse files
set timeout first
1 parent 023d11e commit 09b9899

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pioreactor/actions/leader/export_experiment_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ def export_experiment_data(
164164
cursor = con.cursor()
165165
cursor.executescript(
166166
"""
167+
PRAGMA busy_timeout = 15000;
167168
PRAGMA journal_mode=WAL;
168169
PRAGMA synchronous = 1; -- aka NORMAL, recommended when using WAL
169170
PRAGMA temp_store = 2; -- stop writing small files to disk, use mem
170-
PRAGMA busy_timeout = 15000;
171171
PRAGMA foreign_keys = ON;
172172
PRAGMA auto_vacuum = INCREMENTAL;
173173
PRAGMA cache_size = -4000;

pioreactor/utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ def __enter__(self):
296296
self.cursor = self.conn.cursor()
297297
self.cursor.executescript(
298298
"""
299+
PRAGMA busy_timeout = 15000;
299300
PRAGMA journal_mode=WAL;
300301
PRAGMA synchronous = 1; -- aka NORMAL, recommended when using WAL
301302
PRAGMA temp_store = 2; -- stop writing small files to disk, use mem
302-
PRAGMA busy_timeout = 15000;
303303
PRAGMA foreign_keys = ON;
304304
PRAGMA auto_vacuum = INCREMENTAL;
305305
PRAGMA cache_size = -4000;
@@ -614,9 +614,9 @@ class JobManager:
614614
def __init__(self) -> None:
615615
db_path = config.get("storage", "temporary_cache")
616616
self.conn = sqlite3.connect(db_path, isolation_level=None)
617+
self.conn.execute("PRAGMA busy_timeout = 15000;")
617618
self.conn.execute("PRAGMA journal_mode=WAL;")
618619
self.conn.execute("PRAGMA synchronous = NORMAL;")
619-
self.conn.execute("PRAGMA busy_timeout = 15000;")
620620
self.conn.execute("PRAGMA temp_store = 2;")
621621
self.conn.execute("PRAGMA foreign_keys = ON;")
622622
self.conn.execute("PRAGMA auto_vacuum = INCREMENTAL;")

pioreactor/utils/sqlite_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def __init__(self, file_name: str, max_queue_size: int = 100, raise_on_error: bo
6161
self._sqlite3_cursor = self._sqlite3_conn.cursor()
6262
self._sqlite3_cursor.executescript(
6363
"""
64+
PRAGMA busy_timeout = 15000;
6465
PRAGMA synchronous = 1; -- aka NORMAL, recommended when using WAL
6566
PRAGMA temp_store = 2; -- stop writing small files to disk, use mem
66-
PRAGMA busy_timeout = 15000;
6767
PRAGMA auto_vacuum = INCREMENTAL;
6868
PRAGMA cache_size = -4000;
6969
"""

0 commit comments

Comments
 (0)