refactor(*): 稳定期治理 - 收敛核心架构、错误语义并修复跨项目数据竞态

This commit is contained in:
ddCat
2026-09-09 22:02:10 +08:00
parent bacd502f5c
commit b5f3413ded
298 changed files with 12681 additions and 26428 deletions

View File

@@ -155,7 +155,7 @@ func enforceRateLimit(c *gin.Context, key string, limit int, window time.Duratio
wait := runtimeService.RequestRetryAfter(c.Request.Context(), key, window)
seconds := max(1, int((wait+time.Second-1)/time.Second))
c.Header("Retry-After", strconv.Itoa(seconds))
fail(c, http.StatusTooManyRequests, fmt.Errorf("请求次数已达上限,请在 %d 秒后重试", seconds))
failService(c, service.RateLimited(fmt.Sprintf("请求次数已达上限,请在 %d 秒后重试", seconds)))
return false
}