From 9c34449035d944f5cd673dffd0b815901ba1d5fa Mon Sep 17 00:00:00 2001 From: Samuel Date: Wed, 12 Feb 2020 16:34:28 +0100 Subject: [PATCH] fix celery scheduler this has not been done when introducing composite and aggregate tuples. --- backend/backend/celery.py | 9 ++++++++- backend/substrapp/tasks/tasks.py | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/backend/celery.py b/backend/backend/celery.py index 7e5e38908..13bd28c93 100644 --- a/backend/backend/celery.py +++ b/backend/backend/celery.py @@ -21,13 +21,20 @@ @app.on_after_configure.connect def setup_periodic_tasks(sender, **kwargs): - from substrapp.tasks.tasks import prepare_training_task, prepare_testing_task + from substrapp.tasks.tasks import (prepare_training_task, + prepare_testing_task, + prepare_aggregate_task, + prepare_composite_training_task) period = int(os.environ.get('SCHEDULE_TASK_PERIOD', 3 * 3600)) sender.add_periodic_task(period, prepare_training_task.s(), queue='scheduler', name='query Traintuples to prepare train task on todo traintuples') sender.add_periodic_task(period, prepare_testing_task.s(), queue='scheduler', name='query Testuples to prepare test task on todo testuples') + sender.add_periodic_task(period, prepare_aggregate_task.s(), queue='scheduler', + name='query Aggregatetuples to prepare task on todo aggregatetuples') + sender.add_periodic_task(period, prepare_composite_training_task.s(), queue='scheduler', + name='query CompositeTraintuples to prepare task on todo composite_traintuples') @after_task_publish.connect diff --git a/backend/substrapp/tasks/tasks.py b/backend/substrapp/tasks/tasks.py index de522f7de..e0452ac78 100644 --- a/backend/substrapp/tasks/tasks.py +++ b/backend/substrapp/tasks/tasks.py @@ -409,6 +409,11 @@ def prepare_testing_task(): prepare_task(TESTTUPLE_TYPE) +@app.task(ignore_result=True) +def prepare_composite_training_task(): + prepare_task(COMPOSITE_TRAINTUPLE_TYPE) + + @app.task(ignore_result=True) def prepare_aggregate_task(): prepare_task(AGGREGATETUPLE_TYPE)