From f67f435a1cac618a3b4a20c027a1c63b53c014b4 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 4 Oct 2023 13:34:31 -0400 Subject: [PATCH] Ignore celery results when appropriate --- worker/tasks.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/worker/tasks.py b/worker/tasks.py index 392582b7..5ca8f24c 100644 --- a/worker/tasks.py +++ b/worker/tasks.py @@ -31,7 +31,7 @@ redis_client = redis.Redis.from_url(settings.CELERY_BROKER_URL) # What class to use for async results, since during testing we need to mock it TestSafeAsyncResult = worker.celery.MockAsyncResult if settings.TESTING else app.AsyncResult -@app.task +@app.task(ignore_result=True) def update_nodes_info(): if settings.NODE_OPTIMISTIC_MODE: return @@ -57,7 +57,7 @@ def update_nodes_info(): processing_node.hostname = check_hostname processing_node.save() -@app.task +@app.task(ignore_result=True) def cleanup_projects(): # Delete all projects that are marked for deletion # and that have no tasks left @@ -68,7 +68,7 @@ def cleanup_projects(): logger.info("Deleted {} projects".format(count_dict['app.Project'])) -@app.task +@app.task(ignore_result=True) def cleanup_tmp_directory(): # Delete files and folder in the tmp directory that are # older than 24 hours @@ -99,7 +99,7 @@ def setInterval(interval, func, *args): t.start() return stopped.set -@app.task +@app.task(ignore_result=True) def process_task(taskId): lock_id = 'task_lock_{}'.format(taskId) cancel_monitor = None @@ -159,7 +159,7 @@ def get_pending_tasks(): processing_node__isnull=False, partial=False) | Q(pending_action__isnull=False, partial=False)) -@app.task +@app.task(ignore_result=True) def process_pending_tasks(): tasks = get_pending_tasks() for task in tasks: @@ -207,7 +207,7 @@ def export_pointcloud(self, input, **opts): logger.error(str(e)) return {'error': str(e)} -@app.task +@app.task(ignore_result=True) def check_quotas(): profiles = Profile.objects.filter(quota__gt=-1) for p in profiles: