Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/task.py
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | class Task(celery.app.task.Task, metaclass=TaskType): | ||||
Current implementation is based on Celery. See | Current implementation is based on Celery. See | ||||
http://docs.celeryproject.org/en/latest/reference/celery.app.task.html for | http://docs.celeryproject.org/en/latest/reference/celery.app.task.html for | ||||
how to use tasks once instantiated | how to use tasks once instantiated | ||||
""" | """ | ||||
abstract = True | abstract = True | ||||
task_queue = 'celery' | |||||
def run(self, *args, **kwargs): | def run(self, *args, **kwargs): | ||||
"""This method is called by the celery worker when a task is received. | """This method is called by the celery worker when a task is received. | ||||
Should not be overridden as we need our special events to be sent for | Should not be overridden as we need our special events to be sent for | ||||
the reccurrent scheduler. Override run_task instead.""" | the reccurrent scheduler. Override run_task instead.""" | ||||
try: | try: | ||||
result = self.run_task(*args, **kwargs) | result = self.run_task(*args, **kwargs) | ||||
Show All 21 Lines |