refactor(rate_limit): refactor API Key rate limiting and remove tenant-level QPS check

- Streamline rate limit check flow by removing redundant tenant-level QPS checks.
- Restrict checks to API Key QPS and plan degradation protection only.
- Update constant naming and error message handling for consistency.
This commit is contained in:
wwq
2026-04-20 17:18:05 +08:00
parent c448cf0660
commit b03300c804
3 changed files with 18 additions and 72 deletions

View File

@@ -18,7 +18,7 @@ from app.core.quota_manager import (
get_quota_usage,
_check_quota,
QuotaUsageRepository,
TENANT_QPS_REDIS_KEY,
API_KEY_QPS_REDIS_KEY,
)
__all__ = [
@@ -34,5 +34,5 @@ __all__ = [
"get_quota_usage",
"_check_quota",
"QuotaUsageRepository",
"TENANT_QPS_REDIS_KEY",
"API_KEY_QPS_REDIS_KEY",
]