Reverting to django tasks scheduler version
This commit is contained in:
@@ -11,7 +11,6 @@ https://docs.djangoproject.com/en/5.1/ref/settings/
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from scheduler.types import SchedulerConfiguration
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
@@ -111,7 +110,35 @@ CACHES = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
'''
|
||||||
|
from scheduler.types import SchedulerConfiguration, QueueConfiguration, Broker
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
# https://django-tasks-scheduler.readthedocs.io/en/latest/configuration/
|
# https://django-tasks-scheduler.readthedocs.io/en/latest/configuration/
|
||||||
|
SCHEDULER_CONFIG = SchedulerConfiguration(
|
||||||
|
DEFAULT_JOB_TIMEOUT = os.environ.get("JOB_DEFAULT_TIMEOUT", 60*30), # 30 minutes
|
||||||
|
BROKER=Broker.REDIS,
|
||||||
|
)
|
||||||
|
|
||||||
|
SCHEDULER_QUEUES: Dict[str, QueueConfiguration] = {
|
||||||
|
'default': QueueConfiguration(
|
||||||
|
HOST = os.environ.get("REDIS_HOST", "localhost"),
|
||||||
|
PORT = os.environ.get("REDIS_PORT", 6379),
|
||||||
|
DB = os.environ.get("REDIS_DB", 0),
|
||||||
|
),
|
||||||
|
'high': QueueConfiguration(
|
||||||
|
HOST = os.environ.get("REDIS_HOST", "localhost"),
|
||||||
|
PORT = os.environ.get("REDIS_PORT", 6379),
|
||||||
|
DB = os.environ.get("REDIS_DB", 0),
|
||||||
|
),
|
||||||
|
'low': QueueConfiguration(
|
||||||
|
HOST = os.environ.get("REDIS_HOST", "localhost"),
|
||||||
|
PORT = os.environ.get("REDIS_PORT", 6379),
|
||||||
|
DB = os.environ.get("REDIS_DB", 0),
|
||||||
|
),
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
SCHEDULER_QUEUES = {
|
SCHEDULER_QUEUES = {
|
||||||
'default': {
|
'default': {
|
||||||
'HOST': os.environ.get("REDIS_HOST", "localhost"),
|
'HOST': os.environ.get("REDIS_HOST", "localhost"),
|
||||||
@@ -129,10 +156,13 @@ SCHEDULER_QUEUES = {
|
|||||||
'DB': os.environ.get("REDIS_DB", 0),
|
'DB': os.environ.get("REDIS_DB", 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SCHEDULER_CONFIG = {
|
||||||
|
'DEFAULT_TIMEOUT': os.environ.get("JOB_DEFAULT_TIMEOUT", 60*30), # 30 minutes
|
||||||
|
'DEFAULT_RESULT_TTL': 60*60*12, # 12 hours
|
||||||
|
'EXECUTIONS_IN_PAGE': 20,
|
||||||
|
'SCHEDULER_INTERVAL': 10, # 10 seconds
|
||||||
|
}
|
||||||
|
|
||||||
SCHEDULER_CONFIG = SchedulerConfiguration(
|
|
||||||
DEFAULT_JOB_TIMEOUT = os.environ.get("JOB_DEFAULT_TIMEOUT", 60*30), # 30 minutes
|
|
||||||
)
|
|
||||||
|
|
||||||
# Password validation
|
# Password validation
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
django==5.1
|
django==5.1
|
||||||
psycopg[binary]
|
django-tasks-scheduler==3.0.1
|
||||||
django-redis
|
django-redis
|
||||||
django-tasks-scheduler
|
psycopg[binary]
|
||||||
gunicorn
|
gunicorn
|
||||||
whitenoise
|
whitenoise
|
||||||
feedparser
|
feedparser
|
||||||
|
|||||||
Reference in New Issue
Block a user