fix: OnlineSince Calculation

pull/1080/head
Dipesh K.C 2022-03-08 09:20:21 +05:45 committed by GitHub
parent aa515545db
commit 56f190cb31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -287,12 +287,8 @@ func (s *Service) OnlineSince(ago time.Time) float32 {
return s.Online24Hours
}
avg := (float64(failsList) / float64(hitsList)) * 100
avg = 100 - avg
if avg < 0 {
avg = 0
}
amount, _ := strconv.ParseFloat(fmt.Sprintf("%0.2f", avg), 10)
amount := (hitsList / totalList) * 100
s.Online24Hours = float32(amount)
return s.Online24Hours
}