How do you deploy cron jobs to production?

后端 未结 9 1027
北海茫月
北海茫月 2021-02-01 18:42

How do people deploy/version control cronjobs to production? I\'m more curious about conventions/standards people use than any particular solution, but I happen to be using git

9条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 19:01

    You said:

    I'm more curious about conventions/standards people use than any particular solution

    But, to be fair, the particular solution will depend in your environment and there is no universal elegant silver bullet. Given that you happen to be using Python/Django, I recommend Celery. It is an asynchronous task queue for Python, which integrates nicely with Django. And, on top of the features that it gives as an asynchronous task queue, it also has specific features for periodic tasks.

    I have personally used the django-celery-beat integration and it integrates perfectly with Django settings and behaves correctly in distributed environments. If your periodic tasks are related to Django stuff, I strongly recommend to take a look at Celery I started using it only for certain asynchronous mailing and ended up using it for a lot of asynchronous tasks + periodic sanity checks and other web application maintenance stuff.

提交回复
热议问题