Files
app-cli/deploy/fashion-spider.service

27 lines
920 B
Desktop File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[Unit]
Description=Fashion spider worker (claims crawl tasks from backend)
Documentation=https://git.23cm.cn/toom1996/spider
After=network-online.target docker.service
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/fashion/spider
# -c 指定生产配置(endpoint 指向 127.0.0.1:18092,与后端 HMAC 密钥对齐)
# -w 1:同时抓 1 个品牌。抓取是带宽密集的活,多开会互相拖慢且更容易被 Vogue 限流。
# -i 5:队列空时每 5 秒轮询一次。
ExecStart=/opt/fashion/spider/bin/spider serve -c /opt/fashion/spider/config.prod.yml -w 1 -i 5
Restart=always
RestartSec=10
# 抓取进程偶尔会因为网络问题卡住,超时后由 systemd 拉起
TimeoutStopSec=30
KillSignal=SIGTERM
# 日志走 journald:journalctl -u fashion-spider -f
StandardOutput=journal
StandardError=journal
SyslogIdentifier=fashion-spider
[Install]
WantedBy=multi-user.target