diff --git a/handlers/services.go b/handlers/services.go index 525a380c..4aa41043 100644 --- a/handlers/services.go +++ b/handlers/services.go @@ -547,14 +547,14 @@ func apiAllServicesStatusHandler(w http.ResponseWriter, r *http.Request) { var srvs []services.ServiceWithDowntime m := make(map[int64]downtimes.Downtime) if t == "" { - dtime:=downtimes.FindDowntime2() timeNow := time.Now() + dtime:=downtimes.FindDowntime2() for i := 0; i < len(dtime); i++ { downtimeVar := dtime[i] serviceVar,_ := services.Find(downtimeVar.ServiceId) checkInterval := time.Duration(serviceVar.Interval) timeInstance := timeNow.Add(-time.Second * checkInterval) - if(timeInstance.After(*(downtimeVar.Start)) || timeInstance.Equal(*(downtimeVar.Start)) ) && (downtimeVar.End == nil || (timeInstance.Before(*(downtimeVar.End)) || timeInstance.Equal(*(downtimeVar.End))) ){ + if downtimeVar.End == nil || timeInstance.Before(*(downtimeVar.End)) || timeInstance.Equal(*(downtimeVar.End)) { m[downtimeVar.ServiceId] = downtimeVar } }