Exemplo n.º 1
0
def run_worker(concurrency='4', beat=False):
    """Runs the celery worker"""
    args = sys.argv[:1]
    args += ('-c', concurrency)
    if beat:
        args += ('-B', '-s', 'tmp/celerybeat-schedule')
    with make_app().app_context():
        celery.worker_main(args)
Exemplo n.º 2
0
def main():
    manager = Manager(make_app(), with_default_commands=False)

    manager.command(run_worker)
    manager.command(update_pypi)

    manager.add_command('shell', Shell(make_context=_make_shell_context))
    manager.add_command('run', Server())

    manager.run()