summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/api/analytics/init.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/system/api/analytics/init.go b/system/api/analytics/init.go
index 6c66007..8117f2a 100644
--- a/system/api/analytics/init.go
+++ b/system/api/analytics/init.go
@@ -192,11 +192,16 @@ func ChartData() (map[string]interface{}, error) {
}
// append request to requests for analysis if its timestamp is today
- // or if its day is not already in cache
+ // or if its day is not already in cache, otherwise delete it
d := time.Unix(r.Timestamp/1000, 0)
_, inCache := currentMetrics[d.Format("01/02")]
if !d.Before(today) || !inCache {
requests = append(requests, r)
+ } else {
+ err := b.Delete(k)
+ if err != nil {
+ return err
+ }
}
return nil