Skip to content

Commit

Permalink
Time zone bug
Browse files Browse the repository at this point in the history
Changing the time zone required a restart previously
  • Loading branch information
aunefyren committed Jul 5, 2022
1 parent 384c304 commit 889fa51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion route_admin_auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func ApiSetConfig(w http.ResponseWriter, r *http.Request) {

} else if config_payload.DataType == "wrapperr_data" {

_, err := time.LoadLocation(config_payload.WrapperrData.Timezone)
new_time, err := time.LoadLocation(config_payload.WrapperrData.Timezone)
if err != nil {
log.Println("Failed to set the new time zone. Error: ")
log.Println(err)
Expand All @@ -133,6 +133,8 @@ func ApiSetConfig(w http.ResponseWriter, r *http.Request) {
return
}

time.Local = new_time

} else {
log.Println("Cannot set new config. Invalid data type recieved. Type: " + config_payload.DataType)
respond_default_error(w, r, errors.New("Failed to save new Wrapperr confguration."), 400)
Expand Down

0 comments on commit 889fa51

Please sign in to comment.