python - 使用Supervisor启动Huey(Redis Celery)消费者

标签 python redis celery supervisord

我目前有一个“cons.sh”文件,用于启动我的 Huey(Celery Redis 的基本版本)消费者。

内容如下:

#!/bin/bash
echo "smsbot handler"
echo "-------------"
echo "Waiting for tasks'"
echo "Stop the handler using Ctrl+C"
PYTHONPATH=.:$PYTHONPATH huey_consumer.py main.huey --threads=3

现在我想使用 Supervisor 来保持它的运行,但看起来,我不能让 supervisor 启动 shell 脚本,我必须让它启动 python 脚本。

谁能告诉我如何使用 python 程序启动“huey_consumer.py”程序(假定它不在我的项目目录中,它是 huey 模块的一部分)?以便我可以使用 supervisor 启动它?

几天来我一直在为这个问题苦苦挣扎,但我终究无法弄明白。

(如果有帮助,我不会像大多数其他教程那样将 Django 与 Huey 一起使用)

所以基本上我需要开始:

PYTHONPATH=.:$PYTHONPATH huey_consumer.py main.huey --threads=3

使用主管,因为目前我正在使用“nohup”,这并不理想!

最佳答案

改用纯 Clery,更好的文档

关于python - 使用Supervisor启动Huey(Redis Celery)消费者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19966557/

相关文章:

python - gettar 属性错误 - Python

python - Django 中的父子关系

RedisBloom : Option to add items (bit strings) as is with no hashing?

python - 消费者 : Cannot connect to amqp://guest:**@127. 0.0.1:5672//: [Errno 61] 连接被拒绝

flask - Flask on Railway 中的 Celery[redis] 中的任务正在等待处理

python - Zipline 的 iPython 魔法找不到数据包

python - python 中是否有任何 strncpy() 等效函数?

c# - Booksleve 中的 Redis 事务

spring-boot - 如何将 Redis 连接到 Spring Boot?

python - Celery 与 ProcessPoolExecutor/ThreadPoolExecutor