【发布时间】:2020-08-26 16:26:14
【问题描述】:
我正在运行一个 Django 应用程序,该应用程序使用 Celery 并使用 Redis 服务器作为工作线程来运行异步任务。
我需要能够停止整个基础架构并将其恢复,而不会导致任务执行中断。 所以我需要这样做:
1) Stop the Django webservice
2) Stop celery
3) Shut down Redis daemon
4) Make a few changes in the server or move to a different machine
5) Start Redis daemon
6) Start Celery
7) Start the Django webservice
当整个基础架构再次备份时,它应该从中断的地方继续。也就是说,如果队列中有任何任务,它应该继续执行它们。
我该怎么做呢?有没有办法保存队列并稍后继续?
【问题讨论】:
-
查看这个答案*.com/a/56978911/6340775
标签: django redis celery django-celery task-queue