Skip to content

Commit 29a449f

Browse files
bobo-xxxSoultergemini-code-assist[bot]
authored
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>
1 parent e98eb92 commit 29a449f

File tree

1 file changed

+2
-0
lines changed
  • astrbot/core/pipeline/rate_limit_check

1 file changed

+2
-0
lines changed

astrbot/core/pipeline/rate_limit_check/stage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ async def process(
6363
timestamps = self.event_timestamps[session_id]
6464
self._remove_expired_timestamps(timestamps, now)
6565

66+
if self.rate_limit_count <= 0:
67+
break
6668
if len(timestamps) < self.rate_limit_count:
6769
timestamps.append(now)
6870
break

0 commit comments

Comments
 (0)