Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Log messages when server is reloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
LordRalex committed Feb 24, 2018
1 parent ab62911 commit ed493ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions httphandlers/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,15 @@ func validateToken(accessToken string, gin *gin.Context) bool {
errMsg := make(map[string]string)
errMsg["error"] = err.Error()
gin.JSON(500, errMsg)
gin.Abort()
return false
}
if response.StatusCode != 200 {
logging.Error("Unexpected response code from auth server", response.StatusCode)
errMsg := make(map[string]string)
errMsg["error"] = fmt.Sprintf("Received response %i", response.StatusCode)
gin.JSON(500, errMsg)
gin.Abort()
return false
}
var respArr map[string]interface{}
Expand All @@ -160,6 +162,7 @@ func validateToken(accessToken string, gin *gin.Context) bool {
errMsg := make(map[string]string)
errMsg["error"] = "Failed to parse auth server response"
gin.JSON(500, errMsg)
gin.Abort()
return false
}
if respArr["active"].(bool) == false {
Expand Down
2 changes: 2 additions & 0 deletions programs/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,13 @@ func Reload(id string) (err error) {
err = errors.New("server does not exist")
return
}
logging.Infof("Reloading server %s", temp.Id())
//have to cast it for this to work
program, _ := temp.(*ProgramData)

newVersion, err := Load(id)
if err != nil {
logging.Error("error reloading server", err)
return
}

Expand Down

0 comments on commit ed493ed

Please sign in to comment.