|
|
8 ماه پیش | |
|---|---|---|
| .. | ||
| README.md | 8 ماه پیش | |
| backfill_intimacy_hearts.py | 8 ماه پیش | |
| daily_deduct.conf | 8 ماه پیش | |
| daily_deduct_intimacy.py | 8 ماه پیش | |
| run_backfill.sh | 8 ماه پیش | |
| run_daily_deduct.sh | 8 ماه پیش | |
| sync_deduct_conf.py | 8 ماه پیش | |
daily_deduct.conf 读取([database] 与 [service])。其中 [database] 可由 sync_deduct_conf.py 从 sendmsg/send.conf 同步填充:执行 python user-star/sync_deduct_conf.py 即可。在项目根目录执行:
# 一次性:历史用户补 3 颗心
bash backend/user-star/run_backfill.sh
# 每日扣心(建议 crontab 每天 0 点)
bash backend/user-star/run_daily_deduct.sh
在 backend 目录执行:
# 一次性
bash user-star/run_backfill.sh
# 每日扣心
bash user-star/run_daily_deduct.sh
或直接调用 Python:
# 首次或 send.conf 变更后:把 sendmsg/send.conf 的 [database] 同步到 daily_deduct.conf
python user-star/sync_deduct_conf.py
# 每日扣心:在任意目录执行均可,仅读 user-star/daily_deduct.conf
python user-star/daily_deduct_intimacy.py
# 历史补心:需在 backend 目录下以加载 .env
cd backend && python user-star/backfill_intimacy_hearts.py
0 0 * * * cd /path/to/Lyrria/backend && python user-star/daily_deduct_intimacy.py >> /tmp/daily_deduct_intimacy.log 2>&1
将 /path/to/Lyrria/backend 替换为实际 backend 绝对路径。