sms
This commit is contained in:
1 parent
250cdbab7f
commit
5c6069c3ef
87 files changed
+29209
-3697
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"""سیگنالهای اپ admin_panel."""
|
||||
import logging
|
||||
|
||||
from django.db.backends.signals import connection_created
|
||||
from django.dispatch import receiver
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@receiver(connection_created)
|
||||
def configure_sqlite_connection(sender, connection, **kwargs):
|
||||
"""افزایش busy_timeout برای SQLite تا نوشتن همزمان web/worker/scheduler خطا ندهد."""
|
||||
if connection.vendor != "sqlite":
|
||||
return
|
||||
try:
|
||||
with connection.cursor() as cursor:
|
||||
cursor.execute("PRAGMA busy_timeout=30000;")
|
||||
except Exception:
|
||||
logger.warning("تنظیم busy_timeout برای SQLite ناموفق بود.", exc_info=True)
|
||||
Reference in new issue
Block a user