Просмотр исходного кода

Add systemd unit for daily Douyin automation

Sam Lee 2 недель назад
Родитель
Сommit
d42ad82468

+ 19 - 0
deploy/systemd/cfa-daily-douyin-after-demand.service

@@ -0,0 +1,19 @@
+[Unit]
+Description=CFA daily Douyin runs and AIGC push after Demand Agent
+Wants=network-online.target
+After=network-online.target mysqld.service mariadb.service mysql.service
+
+[Service]
+Type=oneshot
+User=sam
+Group=sam
+WorkingDirectory=/home/sam/ContentFindAgentNew
+Environment=PYTHONUNBUFFERED=1
+Environment=PYTHONPATH=/home/sam/ContentFindAgentNew
+Environment=CONTENT_AGENT_ENV_FILE=/home/sam/ContentFindAgentNew/.env
+Environment=CAN_NOT_CREATE_PLAN=false
+Environment=CFA_DAILY_TOP_N=2
+Environment=CFA_DAILY_SELECTION_MODE=top-category-count
+TimeoutStartSec=24h
+ExecStart=/bin/bash -lc '.venv/bin/python -m scripts.daily_auto_douyin_and_aigc --date $(date +%%Y%%m%%d) --top-n "${CFA_DAILY_TOP_N:-2}" --selection-mode "${CFA_DAILY_SELECTION_MODE:-top-category-count}" --live'
+

+ 3 - 0
deploy/systemd/demand-agent-hive-gap.service.d/cfa-daily-douyin.conf

@@ -0,0 +1,3 @@
+[Unit]
+OnSuccess=cfa-daily-douyin-after-demand.service
+