Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5057

Schedule task to run once daily at specific time | Celery

$
0
0

I want to schedule running two tasks at 16h UTC once per day.

To do so, I've implemented this celery config:

from celery.schedules import crontabCELERY_IMPORTS = ('api.tasks')CELERY_TASK_RESULT_EXPIRES = 30CELERY_TIMEZONE = 'UTC'CELERYBEAT_SCHEDULE = {'book-task': {'task': 'api.tasks.get_data',        # At 16h UTC everyday'schedule': crontab(hour=16),'args': ({'book'}),    },'pencils-task': {'task': 'api.tasks.get_data',        # At 16h UTC everyday'schedule': crontab(hour=16),'args': ({'pencil'}),    }}

I run celery worker -A app.celery --loglevel=info --pool=solo to run the celery worker after running celery beat -A app.celery to launch celery beat.

With the config above, I have my two tasks running every minute starting 16h UTC. What is wrong with my config and how to fix ?


Viewing all articles
Browse latest Browse all 5057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>