我有一個使用mod_wsgi守護進程測試Django站點,並且已經設置了一個簡單的Celery任務來通過電子郵件發送一個聯繫表,並安裝了主管。在監督員上運行Ubuntu上的芹菜任務
我知道Django代碼是正確的。
我遇到的問題是,當我提交表單時,我只收到一條消息 - 第一條。聯繫表單的後續完成完全不會發送任何消息。
在我的服務器上,我有另一個測試站點,運行配置好的監控任務,使用Django服務器(即不使用mod_wsgi)。我的兩個任務都運行良好,如果我做
sudo supervisorctl status
這裏是我上面這已經描述了被保存在
/etc/supervisor/conf.d
用戶在這種情況下被稱爲myuser的
任務我的conf文件[program:test_project]
command=/home/myuser/virtualenvs/test_project_env/bin/celery -A test_project worker --loglevel=INFO --concurrency=10 -n [email protected]%%h
directory=/home/myuser/djangoprojects/test_project
user=myuser
numprocs=1
stdout_logfile=/var/log/celery/test_project.out.log
stderr_logfile=/var/log/celery/test_project.err.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
stopasgroup=true
; Set Celery priority higher than default (999)
; so, if rabbitmq is supervised, it will start first.
priority=1000
我的其他測試網站有這個集合的命令 - 注意worker1 @ %%^h
command=/home/myuser/virtualenvs/another_test_project_env/bin/celery -A another_test_project worker --loglevel=INFO --concurrency=10 -n [email protected]%%h
我明顯做錯了,我的表單只提交。如果我查看上面提到的out.log文件,我只會看到第一個任務,其他表單提交內容都不可見。
非常感謝提前。
UPDATE
我提交的第一種形式,在上午08點32分(GMT),將其接收,然後,如上所述,另一個此後不久爲其中未創建的任務。在完成問題後,我再次以9.15提交了表格,爲此創建了一個任務並收到了消息!然後我再次提交表單,但沒有再次創建任務。希望這可以幫助!
嗨,非常感謝回到我身邊。我的supervisor conf文件中已經有stopasagroup = true。關於您對RabbitMQ的評論,我是否需要這樣做,因爲我沒有使用虛擬主機運行unbuntu? (即我沒有使用Plesk - 請原諒我對此的無知)。在此期間,我會看看提供的鏈接 - 非常感謝 – Newfoundland
嗨,我遵循你給的指示,並得到它的工作 - 非常感謝 - 非常感謝 – Newfoundland
我的榮幸.... – Ykh