feat: 新增使用量统计功能,与key切换脱钩

This commit is contained in:
Rock Chin
2023-01-03 17:50:13 +08:00
parent 5a13e60587
commit e06a2535dd
8 changed files with 141 additions and 3 deletions
+3
View File
@@ -28,6 +28,9 @@ class KeysManager:
def get_using_key(self):
return self.using_key
def get_using_key_md5(self):
return hashlib.md5(self.using_key.encode('utf-8')).hexdigest()
def __init__(self, api_key):
# if hasattr(config, 'api_key_usage_threshold'):
# self.api_key_usage_threshold = config.api_key_usage_threshold