Skip to content

Commit

Permalink
fix: controller version call
Browse files Browse the repository at this point in the history
  • Loading branch information
wintbiit committed Sep 22, 2024
1 parent aaa8d4a commit bd0b400
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions controllers/system_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,7 @@ func (c *ApiController) GetSystemInfo() {
// @Success 200 {object} util.VersionInfo The Response object
// @router /get-version-info [get]
func (c *ApiController) GetVersionInfo() {
errInfo := ""
versionInfo, err := util.GetVersionInfo()
if err != nil {
errInfo = "Git error: " + err.Error()
}

if versionInfo.Version != "" {
c.ResponseOk(versionInfo)
return
}

versionInfo, err = util.GetVersionInfoFromFile()
if err != nil {
errInfo = errInfo + ", File error: " + err.Error()
c.ResponseError(errInfo)
return
}
versionInfo, _ := util.GetVersionInfo()

c.ResponseOk(versionInfo)
}
Expand Down

0 comments on commit bd0b400

Please sign in to comment.