Scheduled tasks interval, env vars, view fix

This commit is contained in:
Luciano Gervasoni
2025-06-20 09:59:27 +02:00
parent 03a2949b2b
commit f659d4adb3
3 changed files with 8 additions and 6 deletions

View File

@@ -119,7 +119,7 @@ SCHEDULER_CONFIG = SchedulerConfiguration(
DEFAULT_SUCCESS_TTL=10 * 60, # Time To Live (TTL) in seconds to keep successful job results
DEFAULT_FAILURE_TTL=365 * 24 * 60 * 60, # Time To Live (TTL) in seconds to keep job failure information
DEFAULT_JOB_TTL=10 * 60, # Time To Live (TTL) in seconds to keep job information
DEFAULT_JOB_TIMEOUT=30 * 60, # timeout (seconds) for a job
DEFAULT_JOB_TIMEOUT=os.environ.get("JOB_DEFAULT_TIMEOUT", 60*30), # timeout (seconds) for a job
# General configuration values
DEFAULT_WORKER_TTL=10 * 60, # Time To Live (TTL) in seconds to keep worker information after last heartbeat
DEFAULT_MAINTENANCE_TASK_INTERVAL=10 * 60, # The interval to run maintenance tasks in seconds. 10 minutes.
@@ -127,7 +127,6 @@ SCHEDULER_CONFIG = SchedulerConfiguration(
SCHEDULER_FALLBACK_PERIOD_SECS=120, # Period (secs) to wait before requiring to reacquire locks
)
SCHEDULER_QUEUES: Dict[str, QueueConfiguration] = {
# 'default': QueueConfiguration(URL='redis://localhost:6379/0'),
'default': QueueConfiguration(URL='redis://{}:{}/{}'.format(os.environ.get("REDIS_HOST", "localhost"), os.environ.get("REDIS_PORT", 6379), os.environ.get("REDIS_DB", 0))),
'high': QueueConfiguration(URL='redis://{}:{}/{}'.format(os.environ.get("REDIS_HOST", "localhost"), os.environ.get("REDIS_PORT", 6379), os.environ.get("REDIS_DB", 0))),
'low': QueueConfiguration(URL='redis://{}:{}/{}'.format(os.environ.get("REDIS_HOST", "localhost"), os.environ.get("REDIS_PORT", 6379), os.environ.get("REDIS_DB", 0))),

View File

@@ -45,8 +45,11 @@ def url_detail_view(request, id):
url_content = {}
ollama = OllamaClient()
# prompt_content = "{}\n{}\n{}".format(url_content.title, url_content.description, url_content.content)
prompt_content = "{}".format(url_content.content)
try:
# prompt_content = "{}\n{}\n{}".format(url_content.title, url_content.description, url_content.content)
prompt_content = "{}".format(url_content.content)
except Exception as e:
prompt_content = ""
context = {
'url_item': url_item,

View File

@@ -118,7 +118,7 @@
"result_ttl": 86400,
"cron_string": null,
"scheduled_time": "2025-01-01T00:00:00+00:00",
"interval": 1,
"interval": 8,
"interval_unit": "hours",
"successful_runs": 0,
"failed_runs": 0,
@@ -139,7 +139,7 @@
"result_ttl": 86400,
"cron_string": null,
"scheduled_time": "2025-01-01T00:00:00+00:00",
"interval": 1,
"interval": 2,
"interval_unit": "hours",
"successful_runs": 0,
"failed_runs": 0,