Switched to using pure Clery, much better documentation
Using Supervisor to start Huey (Redis Celery) consumer
-
30-07-2022 - |
سؤال
I currently have a 'cons.sh' file that's used to start my Huey (a basic version of Celery Redis) Consumer.
It's contents is as follows:
#!/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
Now I'm wanting to use Supervisor to keep this running, but from what it seems, I can't have supervisor start the shell script, I have to have it start a python script.
Can anyone tell me how I can start the 'huey_consumer.py' program (given that this is not in my project directory it's part of the huey module) using a python program? So that I can start it using supervisor?
I've been struggling with this for a few days now and I can't for the life of me figure it out.
(if it helps, I'm not using Django with Huey, like most of the other tutorials out there)
So basically I need to start:
PYTHONPATH=.:$PYTHONPATH huey_consumer.py main.huey --threads=3
Using supervisor, because at the moment I'm using 'nohup' and that's not exactly ideal!
المحلول