Skip to content
Snippets Groups Projects
Select Git revision
  • 7e845ef92b410bdbcd18f0c9cc50562c3605ca56
  • develop default protected
  • master protected
  • feature/POL1-813-error-report-sensu-check
  • 0.23
  • 0.22
  • 0.21
  • 0.20
  • 0.19
  • 0.18
  • 0.17
  • 0.16
  • 0.15
  • 0.14
  • 0.13
  • 0.12
  • 0.11
  • 0.10
  • 0.9
  • 0.8
  • 0.7
  • 0.6
  • 0.5
  • 0.4
24 results

main.py

Blame
  • worker.py 887 B
    """Module that sets up :term:`GSO` as a Celery worker. This will allow for the scheduling of regular task workflows."""
    
    from celery import Celery
    
    from gso import init_worker_app
    from gso.settings import load_oss_params
    
    
    class OrchestratorCelery(Celery):
        """A :term:`GSO` instance that functions as a Celery worker."""
    
        def on_init(self) -> None:  # noqa: PLR6301
            """Initialise a new Celery worker."""
            init_worker_app()
    
    
    settings = load_oss_params()
    
    celery = OrchestratorCelery(
        "worker",
        broker=settings.CELERY.broker_url,
        backend=settings.CELERY.result_backend,
        include=[
            "gso.schedules.task_vacuum",
            "gso.schedules.validate_products",
            "gso.schedules.validate_subscriptions",
        ],
    )
    
    celery.conf.update(result_expires=settings.CELERY.result_expires)
    celery.conf.update(redbeat_redis_url=settings.CELERY.broker_url)