mirror of
https://github.com/TheSmallHanCat/sora2api.git
synced 2026-02-13 00:44:42 +08:00
fix: 修复管理配置更新缺失字段及日志状态更新机制
- 修复update_admin_config方法未更新task_retry_enabled、task_max_retries、auto_disable_on_401字段的问题 - 新增finally块确保请求日志在异常情况下也能正确更新状态,避免卡在status_code=-1
This commit is contained in:
@@ -1010,9 +1010,12 @@ class Database:
|
||||
async with aiosqlite.connect(self.db_path) as db:
|
||||
await db.execute("""
|
||||
UPDATE admin_config
|
||||
SET admin_username = ?, admin_password = ?, api_key = ?, error_ban_threshold = ?, updated_at = CURRENT_TIMESTAMP
|
||||
SET admin_username = ?, admin_password = ?, api_key = ?, error_ban_threshold = ?,
|
||||
task_retry_enabled = ?, task_max_retries = ?, auto_disable_on_401 = ?,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = 1
|
||||
""", (config.admin_username, config.admin_password, config.api_key, config.error_ban_threshold))
|
||||
""", (config.admin_username, config.admin_password, config.api_key, config.error_ban_threshold,
|
||||
config.task_retry_enabled, config.task_max_retries, config.auto_disable_on_401))
|
||||
await db.commit()
|
||||
|
||||
# Proxy config operations
|
||||
|
||||
Reference in New Issue
Block a user