ronething
2019-08-04 14:05
- 通过设置 priority 并无法解决 worker 进程启动完毕之后再启动 flower 的样子
priority 只是定义了启动顺序。
http://supervisord.org/configuration.html
https://github.com/Supervisor/supervisor/issues/122
可以通过设置 `celery-flower` 的 `autostart=true` 为 `autostart=false` 然后再手动进行启动
```
$ supervisorctl
celery-beat STARTING
celery-flower STOPPED Not started
celery-worker STARTING
supervisor> help
default commands (type help <topic>):
=====================================
add exit open reload restart start tail
avail fg pid remove shutdown status update
clear maintail quit reread signal stop version
supervisor> status
celery-beat RUNNING pid 37555, uptime 0:00:17
celery-flower STOPPED Not started
celery-worker RUNNING pid 37556, uptime 0:00:17
supervisor> start celery-flower
celery-flower: started
supervisor> status
celery-beat RUNNING pid 37555, uptime 0:00:41
celery-flower RUNNING pid 37611, uptime 0:00:15
celery-worker RUNNING pid 37556, uptime 0:00:41
supervisor>
```
或者使用一个脚本监听 `celery-worker` 的 `status` 进行判断 如果是 `RUNNING` 则可以进行启动 `celery-flower`
```
$ supervisorctl status celery-worker | awk '{print $2}'
RUNNING
```
不知道老师有没有其他解决方案。还望得到回复。
Python 异步任务队列 Celery 使用
10849 学习 · 43 问题
相似问题