Skip to content

Commit

Permalink
fix celery scheduler
Browse files Browse the repository at this point in the history
this has not been done when introducing composite and aggregate tuples.
  • Loading branch information
samlesu committed Feb 12, 2020
1 parent e50d663 commit 9c34449
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/backend/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions backend/substrapp/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9c34449

Please sign in to comment.