优化 ChatGPT API 重试逻辑

This commit is contained in:
RockYang
2023-03-20 15:02:42 +08:00
parent 0ca104bac8
commit 3bb6814493
9 changed files with 167 additions and 113 deletions

View File

@@ -73,6 +73,11 @@ func (s *Server) ConfigSetHandle(c *gin.Context) {
// 保存配置文件
logger.Infof("Config: %+v", s.Config)
types.SaveConfig(s.Config, s.ConfigPath)
err = types.SaveConfig(s.Config, s.ConfigPath)
if err != nil {
c.JSON(http.StatusOK, types.BizVo{Code: types.Failed, Message: "Failed to save config file"})
return
}
c.JSON(http.StatusOK, types.BizVo{Code: types.Success, Message: types.OkMsg})
}