fix: handle rate_limit_count=0 to prevent IndexError (#7635)

* fix: handle rate_limit_count=0 to prevent IndexError

* Update astrbot/core/pipeline/rate_limit_check/stage.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
bobo-xxx
2026-04-18 20:37:36 +08:00
committed by GitHub
parent e98eb92b5f
commit 29a449f90d
@@ -63,6 +63,8 @@ class RateLimitStage(Stage):
timestamps = self.event_timestamps[session_id]
self._remove_expired_timestamps(timestamps, now)
if self.rate_limit_count <= 0:
break
if len(timestamps) < self.rate_limit_count:
timestamps.append(now)
break