mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-23 11:17:02 -04:00
check if pragma is already wal before setting
This commit is contained in:
parent
7b7aa239fd
commit
c877d67e0c
1 changed files with 3 additions and 1 deletions
|
@ -1082,7 +1082,9 @@ def setup_django(out_dir: Path=None, check_db=False, config: ConfigDict=CONFIG,
|
||||||
# Enable WAL mode in sqlite3
|
# Enable WAL mode in sqlite3
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
with connection.cursor() as cursor:
|
with connection.cursor() as cursor:
|
||||||
cursor.execute("PRAGMA journal_mode=wal;")
|
current_mode = cursor.execute("PRAGMA journal_mode")
|
||||||
|
if current_mode != 'wal':
|
||||||
|
cursor.execute("PRAGMA journal_mode=wal;")
|
||||||
|
|
||||||
# Create cache table in DB if needed
|
# Create cache table in DB if needed
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue