Skip to content

Commit

Permalink
update for sqlite database write-locks (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Feb 23, 2024
1 parent 70bf2ce commit 64236a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ansible-webui/aw/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _from_env_or_db(setting: str) -> any:
if 'AW_INIT' in environ and environ['AW_INIT'] == '1':
raise AppRegistryNotReady

# pylint: disable = C0415
# pylint: disable=C0415
from aw.model.system import get_config_from_db
return getattr(get_config_from_db(), str(setting))

Expand Down
4 changes: 2 additions & 2 deletions src/ansible-webui/aw/db_sqlite_patched/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# pylint: disable=W0401,W0614
# pylint: disable=W0401,W0614,E0102
from django.db.backends.sqlite3.base import *


# NOTE: quick-patch for https://github.com/django/django/commit/a0204ac183ad6bca71707676d994d5888cf966aa
# todo: remove once feature is available natively in django 5.1

class SQLitePatched(DatabaseWrapper):
class DatabaseWrapper(DatabaseWrapper):
def _start_transaction_under_autocommit(self):
self.cursor().execute('BEGIN IMMEDIATE')

0 comments on commit 64236a0

Please sign in to comment.