Ich bin folgende: Putting RQ under supervisorSupervisord Konfiguration für Django rq nicht
Mein Beruf:
@job("default")
def send_mail(subject, body, sender, receivers, cc=None, bcc=None, content_type='plain', class_name=None):
"""Send email to users."""
*code to send mail.*
Wenn ich laufen
Python manage.py rqworker
I bin in der Lage, Aufgaben mit rq-Warteschlangen auszuführen. Aber nicht mit Supervisord Konfiguration. Supervisord Konfiguration:
Pfad: /etc/supervisord/conf.d/filename.conf
[program:myworker]
; Point the command to the specific rq command you want to run.
; If you use virtualenv, be sure to point it to
; /path/to/virtualenv/bin/rq
; Also, you probably want to include a settings module to configure this
; worker. For more info on that, see http://python-rq.org/docs/workers/
command= /home/user/.virtualenvs/my_project/bin/rq worker
process_name=%(program_name)s
stdout_logfile = /var/log/my_project/redis.log
; If you want to run more than one worker instance, increase this
numprocs=1
; This is the directory from which RQ is ran. Be sure to point this to the
; directory where your source code is importable from
directory=/home/user/github_my_projects/projects/my_project
; RQ requires the TERM signal to perform a warm shutdown. If RQ does not die
; within 10 seconds, supervisor will forcefully kill it
stopsignal=TERM
; These are up to you
autostart=true
autorestart=true
Ist der Service laufen und laufen? Was ist die Ausgabe von 'supervisorctl status'? Haben Sie die Protokolldatei (en) überprüft? Außerdem: Sie verwenden die systemweite supervisord Konfiguration ohne 'user =' Konfiguration, so dass Ihr rq worker jetzt als root ausgeführt wird. Ich bin mir ziemlich sicher, dass du das nicht wolltest. – dhke
Ok, also läuft "supervisorctl status myworker". Ich werde Benutzerdetails hinzufügen. Aber die Logdatei hat: Verbindung zu localhost: 6379. Verbindung abgelehnt – Kishan