fixed the time.now part

pull/1097/head
Rhythm 2022-02-25 17:19:12 +05:30
parent b126b66118
commit aa32a6c5e3
2 changed files with 3 additions and 3 deletions

View File

@ -549,7 +549,7 @@ func apiAllServicesStatusHandler(w http.ResponseWriter, r *http.Request) {
if t == "" { if t == "" {
for _, v := range services.AllInOrder() { for _, v := range services.AllInOrder() {
if v.Online == false { if v.Online == false {
downtime:= downtimes.FindDowntime3(v.Id) downtime := downtimes.FindDowntime2(v.Id)
m[v.Id] = downtime m[v.Id] = downtime
} }
} }

View File

@ -67,9 +67,9 @@ func FindDowntime(timeVar time.Time) []Downtime {
return downtime return downtime
} }
func FindDowntime3(service int64) Downtime { func FindDowntime2(service int64) Downtime {
var downtime Downtime var downtime Downtime
q := db.Where("service = ?",service) q := db.Where("service = ?", service)
q = q.Order("start desc").First(&downtime) q = q.Order("start desc").First(&downtime)
return downtime return downtime
} }