mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
perf: keymgr对已储存的结果取整
This commit is contained in:
@@ -78,6 +78,8 @@ class KeysManager:
|
||||
|
||||
self.usage[md5] += round(int((len(new_content.encode('utf-8')) - len(new_content)) / 2 + len(new_content))*salt_rate)
|
||||
|
||||
self.usage[md5] = int(self.usage[md5])
|
||||
|
||||
if self.usage[md5] >= self.api_key_usage_threshold:
|
||||
switch_result, key_name = self.auto_switch()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user