[Unit]
Description=A 股 Deep Research 定时任务调度器
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/news
Environment="PATH=/home/pi/.local/bin:/usr/local/bin:/usr/bin:/bin"
Environment="LANG=en_US.UTF-8"
Environment="LC_ALL=en_US.UTF-8"
Environment="PYTHONIOENCODING=utf-8"
ExecStart=/home/pi/.local/bin/uv run python -m scripts.run_scheduler
Restart=on-failure
RestartSec=30
StandardOutput=append:/home/pi/news/logs/scheduler.log
StandardError=append:/home/pi/news/logs/scheduler_error.log

# 优雅退出(等当前 pipeline 跑完)
KillSignal=SIGINT
TimeoutStopSec=900

[Install]
WantedBy=multi-user.target
