诚实性修复: API限流Retry-After(wait=60s)+断言 / purge定时接线(04:00 cron+actor+测试) / Channel表单校验(ref+rules+validate) / README PG数字513

This commit is contained in:
seagull
2026-09-12 02:20:50 +08:00
parent b3f3095d53
commit 67540e8d30
40 changed files with 1805 additions and 31 deletions
+10
View File
@@ -7,6 +7,7 @@ worker 启动命令引用本模块以完成 broker 初始化、actor 注册与 c
- 每日 08:00 全租户业务预警扫描(含 AI 应收风险)
- 每日 02:00 电商渠道自动拉单(有凭证店铺)
- 每日 03:00 套餐试用/订阅到期检查(降级 free + 通知)
- 每日 04:00 审计日志保留清理(默认保留 180 天)
"""
# 0. 初始化 Django(worker 进程必须先加载 Django 再注册模型 actor)
@@ -80,3 +81,12 @@ def cron_daily_channel_syncs():
def cron_daily_billing_expiry():
"""每日 03:00 扫描试用/订阅到期 → 降级 free 并发通知。"""
return _run_billing_expiry()
@cron("0 4 * * *")
@dramatiq.actor(max_retries=1)
def cron_daily_audit_purge():
"""每日 04:00 清理过期审计日志(P1-3,默认保留 180 天)。"""
from apps.core import tasks as core_tasks
return core_tasks.purge_expired_audit_logs()