https://github.com/byceps/byceps
Raw File
Tip revision: 7913dde815baf4681bec67f937becfb4b5f89298 authored by Jochen Kupperschmidt on 08 April 2024, 07:20:43 UTC
Tweak user profile header styling
Tip revision: 7913dde
worker.py
#!/usr/bin/env python
"""Run a worker for the job queue.

:Copyright: 2014-2024 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""

from rq import Worker

from byceps.application import create_worker_app
from byceps.util.jobqueue import connection, get_queue
from byceps.util.sentry import configure_sentry_from_env


if __name__ == '__main__':
    configure_sentry_from_env()

    app = create_worker_app()

    with app.app_context():
        with connection():
            queues = [get_queue(app)]

            worker = Worker(queues)
            worker.work(with_scheduler=True)
back to top