mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 08:26:53 +08:00
fix(limit): log accurate wait time after triggering limit
This commit is contained in:
+2
-1
@@ -156,7 +156,8 @@ class ExponentialBackoffRateLimiter(BaseRateLimiter):
|
|||||||
with self.lock:
|
with self.lock:
|
||||||
self.next_allowed_time = current_time + self.current_wait
|
self.next_allowed_time = current_time + self.current_wait
|
||||||
self.current_wait = min(self.current_wait * self.backoff_factor, self.max_wait)
|
self.current_wait = min(self.current_wait * self.backoff_factor, self.max_wait)
|
||||||
self.log_warning(f"触发限流,将在 {self.current_wait} 秒后允许继续调用")
|
wait_time = self.next_allowed_time - current_time
|
||||||
|
self.log_warning(f"触发限流,将在 {wait_time:.2f} 秒后允许继续调用")
|
||||||
|
|
||||||
|
|
||||||
# 时间窗口限流器
|
# 时间窗口限流器
|
||||||
|
|||||||
Reference in New Issue
Block a user