Last active
November 12, 2021 16:23
-
-
Save Senhaji-Rhazi-Hamza/7af33afd3560de606de9812110fb234f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # worker.py | |
| from py_workers.config import CeleryConfig | |
| from celery import Celery | |
| celery_app = Celery( | |
| main=CeleryConfig.APP_NAME, | |
| backend=CeleryConfig.CELERY_RESULT_BACKEND, | |
| broker=CeleryConfig.BROKER_URL, | |
| include=[ | |
| "py_workers.tasks.example.arithmetic", | |
| ], | |
| ) | |
| # celery_app.conf.task_routes = {'py_workers.tasks.*': {'queue': 'pyqueue'}} | |
| celery_app.conf.task_routes = {"py_workers.tasks.*": {"queue": CeleryConfig.QUEUE}} | |
| if __name__ == "__main__": | |
| celery_app.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment