Improve database concurrency
This commit is contained in:
parent
6f62889e92
commit
2f4e16dd54
|
@ -26,6 +26,7 @@ def schedule_tasks(sender, **kwargs):
|
|||
name="Update converted prices",
|
||||
schedule_type=Schedule.MINUTES,
|
||||
next_run=now() + timedelta(seconds=30),
|
||||
catchup=False,
|
||||
)
|
||||
|
||||
if not Schedule.objects.filter(name="Update price per game").exists():
|
||||
|
@ -34,6 +35,7 @@ def schedule_tasks(sender, **kwargs):
|
|||
name="Update price per game",
|
||||
schedule_type=Schedule.MINUTES,
|
||||
next_run=now() + timedelta(seconds=30),
|
||||
catchup=False,
|
||||
)
|
||||
|
||||
from games.models import ExchangeRate
|
||||
|
|
|
@ -113,6 +113,10 @@ DATABASES = {
|
|||
"default": {
|
||||
"ENGINE": "django.db.backends.sqlite3",
|
||||
"NAME": BASE_DIR / "db.sqlite3",
|
||||
"OPTIONS": {
|
||||
"timeout": 20,
|
||||
"init_command": "PRAGMA synchronous=NORMAL; PRAGMA journal_mode=WAL;",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue