mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-01 01:10:21 +08:00
fix: _KeyRotator index bounds check (#9040)
This commit is contained in:
@@ -73,6 +73,8 @@ class _KeyRotator:
|
||||
)
|
||||
|
||||
async with self.lock:
|
||||
if self.index >= len(keys):
|
||||
self.index = 0
|
||||
key = keys[self.index]
|
||||
self.index = (self.index + 1) % len(keys)
|
||||
return key
|
||||
|
||||
Reference in New Issue
Block a user