Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e2fd864bdc |
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Shaguabijia Meituan CPS coupon ETL (灌 meituan_coupon 供销量/佣金排序)
|
||||
After=network-online.target postgresql.service
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
WorkingDirectory=/opt/shaguabijia-app-server
|
||||
# 复用 app-server 的 .env(MT_CPS 凭证 / DATABASE_URL),与 shaguabijia-app-server.service 同源
|
||||
EnvironmentFile=/opt/shaguabijia-app-server/.env
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/opt/shaguabijia-app-server/.venv/bin/python -m scripts.pull_meituan_coupons --once --prune-hours 24
|
||||
# 北京一轮正常 ~2-3min,给 15min 上限防卡死
|
||||
TimeoutStartSec=900
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Run Shaguabijia Meituan CPS coupon ETL (启用即跑一次, 之后每 1h)
|
||||
|
||||
[Timer]
|
||||
# 启用/启动 timer 后立即触发一次(含开机自启、restart timer 时)
|
||||
OnActiveSec=0
|
||||
# 之后每隔 1 小时(相对上次 service 启动时刻)再触发;脚本自带文件锁,单轮 ~8min << 1h 不会重叠
|
||||
OnUnitActiveSec=1h
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user