From adfee76977fb1702ab8ded060090855fd40d32c3 Mon Sep 17 00:00:00 2001 From: bohanjason Date: Sun, 29 Mar 2020 17:15:49 -0400 Subject: [PATCH] disable celery task meta cleanup --- server/website/website/settings/common.py | 3 +++ server/website/website/views.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/server/website/website/settings/common.py b/server/website/website/settings/common.py index 5c71a8e..ce4bcb6 100644 --- a/server/website/website/settings/common.py +++ b/server/website/website/settings/common.py @@ -221,6 +221,9 @@ CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend' # The celerybeat scheduler class CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' +# Celery task meta will not be deleted +CELERY_TASK_RESULT_EXPIRES = None + # Defines the periodic task schedule for celerybeat CELERYBEAT_SCHEDULE = { 'run-every-5m': { diff --git a/server/website/website/views.py b/server/website/website/views.py index c9e25b0..5d89352 100644 --- a/server/website/website/views.py +++ b/server/website/website/views.py @@ -411,7 +411,8 @@ def result_view(request, project_id, session_id, result_id): next_conf_available = False else: task_tuple = JSONUtil.loads(target.task_ids) - task_ids = TaskUtil.get_task_ids_from_tuple(task_tuple) + # For now we ignore the first subtask (i.e., preprocessing) status in GPR/DNN. + task_ids = TaskUtil.get_task_ids_from_tuple(task_tuple)[-3:] tasks = TaskUtil.get_tasks(task_ids) status, _ = TaskUtil.get_task_status(tasks, len(task_ids))