예제 #1
0
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)
예제 #2
0
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'])
예제 #3
0
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"])
예제 #4
0
def worker(options):
    from streamharvester.app import app

    app.config_from_object(options)
    app.start(["celery", "worker"])
예제 #5
0
def worker(options):
    from streamharvester.app import app
    app.config_from_object(options)
    app.start(['celery', 'worker'])
예제 #6
0
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)