忽略密钥文件并添加 Celery 广播 Supervisor 配置

This commit is contained in:
XingQue
2026-06-16 11:25:21 +08:00
parent 4164e82051
commit 4b3032996d
3 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
# Celery 广播 WorkerSupervisor
## 服务器安装(一次性)
```bash
apt install -y supervisor
systemctl enable supervisor && systemctl start supervisor
cd /opt/1panel/apps/openresty/nginx/www/sites/43.142.166.152.443/django
git pull
cp deploy/supervisor/celery-broadcast.conf /etc/supervisor/conf.d/celery-broadcast.conf
supervisorctl reread
supervisorctl update
supervisorctl start celery-broadcast
supervisorctl status celery-broadcast
```
## 验证
```bash
celery -A a_long_dianjing inspect registered | grep dingdan_guangbo
tail -f /var/log/celery-broadcast.log
```
## 日常
```bash
supervisorctl restart celery-broadcast
```
## 注意
- 不要用 `nohup` 再起第二个 celery worker避免抢任务。
-`-Q default`不会跑订单自动结算order_tasks
- 密钥文件 `app_secrets.py` 只放服务器,不要提交 Git。