zlwu c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses
..
README.md c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses
backfill_intimacy_hearts.py c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses
daily_deduct.conf c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses
daily_deduct_intimacy.py c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses
run_backfill.sh c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses
run_daily_deduct.sh c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses
sync_deduct_conf.py c68922eba2 feat(v2.0): V2.0 登录注册流程、i18n 多语言与相关改造 hai 8 meses

README.md

亲密度(三颗心)脚本

  • backfill_intimacy_hearts.py:一次性为历史用户补 3 颗心。
  • daily_deduct_intimacy.py:每日按连续未访问天数扣心。配置:仅从同目录 daily_deduct.conf 读取([database] 与 [service])。其中 [database] 可由 sync_deduct_conf.py 从 sendmsg/send.conf 同步填充:执行 python user-star/sync_deduct_conf.py 即可。

Shell 启动命令

在项目根目录执行:

# 一次性:历史用户补 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

Crontab 示例(每天 0 点跑每日扣心)

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 绝对路径。