Skip to main content

check_image_limit

Function check_image_limit 

Source
pub fn check_image_limit(ip: &str) -> Result<(), Box<Response>>
Expand description

检查图片访问请求是否超出限流阈值。

超限时返回带 Retry-After 头的 429 响应:等待秒数取自 governor 的 NotUntil(到下一个可用令牌的精确时长,向上取整、至少 1s), 客户端可据此安排重试而非盲等。