- stats: fix crash

This commit is contained in:
Simon Zolin
2019-10-09 17:17:57 +03:00
parent f4451dca7b
commit 9ff39a362f
2 changed files with 32 additions and 4 deletions

View File

@@ -551,7 +551,7 @@ func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
}
id++
}
if id < nextDayID {
if id <= nextDayID {
a = append(a, sum)
}
if len(a) != int(s.limit/24) {
@@ -578,7 +578,7 @@ func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
}
id++
}
if id < nextDayID {
if id <= nextDayID {
a = append(a, sum)
}
}
@@ -602,7 +602,7 @@ func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
}
id++
}
if id < nextDayID {
if id <= nextDayID {
a = append(a, sum)
}
}
@@ -626,7 +626,7 @@ func (s *statsCtx) getData(timeUnit TimeUnit) map[string]interface{} {
}
id++
}
if id < nextDayID {
if id <= nextDayID {
a = append(a, sum)
}
}