Skip to content

Commit

Permalink
Ignore celery results when appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Oct 4, 2023
1 parent 1312156 commit f67f435
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions worker/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# 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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -99,7 +99,7 @@ def loop():
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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f67f435

Please sign in to comment.