mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-10 13:10:57 +00:00
feat(keymgr.py): 热重载后重置超额记录
This commit is contained in:
@@ -39,13 +39,10 @@ class KeysManager:
|
|||||||
elif type(api_key) is list:
|
elif type(api_key) is list:
|
||||||
for i in range(len(api_key)):
|
for i in range(len(api_key)):
|
||||||
self.api_key[str(i)] = api_key[i]
|
self.api_key[str(i)] = api_key[i]
|
||||||
|
|
||||||
self.auto_switch()
|
|
||||||
# 从usage中删除未加载的api-key的记录
|
# 从usage中删除未加载的api-key的记录
|
||||||
# 不删了,也许会运行时添加曾经有记录的api-key
|
# 不删了,也许会运行时添加曾经有记录的api-key
|
||||||
|
|
||||||
if 'exceeded_keys' in pkg.utils.context.context and pkg.utils.context.context['exceeded_keys'] is not None:
|
self.auto_switch()
|
||||||
self.exceeded = pkg.utils.context.context['exceeded_keys']
|
|
||||||
|
|
||||||
# 根据tested自动切换到可用的api-key
|
# 根据tested自动切换到可用的api-key
|
||||||
# 返回是否切换成功, 切换后的api-key的别名
|
# 返回是否切换成功, 切换后的api-key的别名
|
||||||
|
|||||||
Reference in New Issue
Block a user