更新配置

This commit is contained in:
Hua
2025-02-19 08:46:26 +08:00
parent e0b133ea1e
commit 7ec5abe67f
3 changed files with 21 additions and 5 deletions

View File

@ -135,8 +135,13 @@ func (h *ConfigHandler) UpdateConfig(c *gin.Context) {
return
}
log.Printf("配置更新成功")
// 更新运行时配置
h.cfg = &newConfig
// 重新初始化 AI 负载均衡器
config.ResetAIBalancer(newConfig.AIs)
log.Printf("配置更新成功")
c.JSON(http.StatusOK, gin.H{"message": "配置更新成功"})
}