Esempio n. 1
0
    def handle(self, *args, **options):
        celery_app.config_from_object('django.conf:settings',
                                      namespace='CELERY')

        # Load task modules from all registered Django app configs.
        celery_app.autodiscover_tasks()

        celery_worker = CeleryWorker(
            hostname="localhost",
            app=celery_app,
        )
        celery_worker.start()
Esempio n. 2
0
    def handle(self, *args, **options):
        celery_app.config_from_object('django.conf:settings',
                                      namespace='CELERY')
        # Load task modules from all registered Django app configs.
        celery_app.autodiscover_tasks()

        celery_worker = CeleryWorker(hostname="localhost",
                                     app=celery_app,
                                     beat=True,
                                     quiet=True,
                                     concurrency=1)

        # Set pidfile if it the corresponding argument has been provided
        if options['pidfile']:
            celery_worker.pidfile = options['pidfile']

        celery_worker.start()