Skip to content

Commit

Permalink
Enforce wal mode
Browse files Browse the repository at this point in the history
We've already enabled this in production, but this ensures dev is wal
mode also
  • Loading branch information
bloodearnest committed May 8, 2024
1 parent d678c5e commit 4e5b29b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jobrunner/cli/manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main():

workspace_dir = local.get_high_privacy_workspace(workspace)
if not workspace_dir.exists():
print(f" - workspace is archived")
print(f" - workspace {workspace} is archived")
continue

level4_dir = local.get_medium_privacy_workspace(workspace)
Expand Down
6 changes: 6 additions & 0 deletions jobrunner/lib/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ def get_connection(filename=None):
conn.row_factory = sqlite3.Row
cache[filename] = conn

# use WAL to enable other processes (e.g. operational tasks) to read the DB.
# job-runner should be the only active writer, which means if we need
# some other process to write the db (e.g. a backfill), then we should
# stop job-runner.
conn.execute("PRAGMA journal_mode=WAL")

return cache[filename]


Expand Down

0 comments on commit 4e5b29b

Please sign in to comment.