def submit_tasks(options): from streamharvester.app import app app.config_from_object(options) for station in options["stations"]: for task, args in tasks_per_station(station): task.apply_async(args)
def scheduler(options): from datetime import timedelta from streamharvester.app import app options['CELERYBEAT_SCHEDULE'] = { 'add-every-30-seconds': { 'task': 'streamharvester.tasks.add', 'schedule': timedelta(seconds=30), 'args': (16, 16) } } app.config_from_object(options) app.start(['celery', 'beat'])
def scheduler(options): from datetime import timedelta from streamharvester.app import app options["CELERYBEAT_SCHEDULE"] = { "add-every-30-seconds": { "task": "streamharvester.tasks.add", "schedule": timedelta(seconds=30), "args": (16, 16), } } app.config_from_object(options) app.start(["celery", "beat"])
def worker(options): from streamharvester.app import app app.config_from_object(options) app.start(["celery", "worker"])
def worker(options): from streamharvester.app import app app.config_from_object(options) app.start(['celery', 'worker'])
def submit_tasks(options): from streamharvester.app import app app.config_from_object(options) for station in options['stations']: for task, args in tasks_per_station(station): task.apply_async(args)