From 035eeea54cfc97613ff8e8e97b55d6f0dc57dde4 Mon Sep 17 00:00:00 2001 From: tcely Date: Thu, 17 Apr 2025 03:24:05 -0400 Subject: [PATCH] Add `SQLITE_DELAY_FLOAT` setting --- tubesync/tubesync/local_settings.py.container | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tubesync/tubesync/local_settings.py.container b/tubesync/tubesync/local_settings.py.container index 4f386b66..bcd70330 100644 --- a/tubesync/tubesync/local_settings.py.container +++ b/tubesync/tubesync/local_settings.py.container @@ -59,6 +59,12 @@ else: } DATABASE_CONNECTION_STR = f'sqlite at "{DATABASES["default"]["NAME"]}"' + # the argument to random.expovariate(), + # a larger value means less delay + # with too little delay, you may see + # more "database is locked" errors + SQLITE_DELAY_FLOAT = 1.5 + DEFAULT_THREADS = 1 BACKGROUND_TASK_ASYNC_THREADS = getenv('TUBESYNC_WORKERS', DEFAULT_THREADS, integer=True)