cache: share ingress rate limits across instances

This commit is contained in:
a.tolmachev
2026-05-03 21:59:49 +00:00
parent 3256203876
commit d3b7d246da
6 changed files with 171 additions and 30 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ pub async fn apply_api_rate_limit(
next: Next,
) -> Result<Response, ApiError> {
let key = rate_limit_key(request.headers(), request.uri().path());
if let Err(rejection) = state.api_rate_limiter.check(&key) {
if let Err(rejection) = state.api_rate_limiter.check(&key).await {
return Err(ApiError::rate_limited_with_context(
"request rate limit exceeded",
rejection_context(rejection),