mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-22 06:03:23 +02:00
autocreate db cache table when needed and reenable WAL mode
This commit is contained in:
@@ -1080,16 +1080,16 @@ def setup_django(out_dir: Path=None, check_db=False, config: ConfigDict=CONFIG,
|
|||||||
django.setup()
|
django.setup()
|
||||||
|
|
||||||
# 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;")
|
cursor.execute("PRAGMA journal_mode=wal;")
|
||||||
|
|
||||||
# Create cache table in DB
|
# Create cache table in DB if needed
|
||||||
# try:
|
try:
|
||||||
# from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
# cache.get('test', None)
|
cache.get('test', None)
|
||||||
# except django.db.utils.OperationalError:
|
except django.db.utils.OperationalError:
|
||||||
# call_command("createcachetable", verbosity=0)
|
call_command("createcachetable", verbosity=0)
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user