This commit is contained in:
GDay
2023-02-23 02:42:13 +01:00
parent 01cb652071
commit a4a4e05dfe
14 changed files with 956 additions and 1268 deletions
+4 -3
View File
@@ -9,7 +9,7 @@ import pkg_resources
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django_q.queues import Queue
from queue import Queue
# optional
try:
@@ -73,7 +73,7 @@ class Conf:
PREFIX = conf.get("name", "default")
# Log output level
LOG_LEVEL = conf.get("log_level", "INFO")
LOG_LEVEL = conf.get("log_level", "DEBUG")
# Maximum number of successful tasks kept in the database. 0 saves everything.
# -1 saves none
@@ -94,7 +94,7 @@ class Conf:
)
# Guard loop sleep in seconds. Should be between 0 and 60 seconds.
GUARD_CYCLE = conf.get("guard_cycle", 0.5)
GUARD_CYCLE = conf.get("guard_cycle", 1)
# Disable the scheduler
SCHEDULER = conf.get("scheduler", True)
@@ -222,6 +222,7 @@ class Conf:
# logger
logger = logging.getLogger("django-q")
# Set up standard logging handler in case there is none
if not logger.hasHandlers():
logger.setLevel(level=getattr(logging, Conf.LOG_LEVEL))