feat(quota): refactor quota management and rate limiting services
- Add `API_KEY_RATE_LIMIT_EXCEEDED` error code. - Refactor `QuotaExceededError` to support resource type localization. - Optimize rate limiting service by implementing the sliding window algorithm. - Add rate limit validation for tenant plans. - Unify quota check decorator to support both synchronous and asynchronous operations. - Enhance quota usage statistics endpoints.
This commit is contained in:
@@ -18,6 +18,7 @@ from app.core.quota_manager import (
|
||||
get_quota_usage,
|
||||
_check_quota,
|
||||
QuotaUsageRepository,
|
||||
TENANT_QPS_REDIS_KEY,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
@@ -33,4 +34,5 @@ __all__ = [
|
||||
"get_quota_usage",
|
||||
"_check_quota",
|
||||
"QuotaUsageRepository",
|
||||
"TENANT_QPS_REDIS_KEY",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user