summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-13 08:55:50 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-13 08:55:50 -0800
commitfeb10ec883258f3b7239398bbc897cec57bab339 (patch)
tree1e1a0ebbd808f7790a603dd5a67527f2913a3dfd
parente73f2d30b2a1a56a7aa629b6ffcd0b1d50bd91d9 (diff)
changing or -> and op in check
-rw-r--r--system/api/analytics/init.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/system/api/analytics/init.go b/system/api/analytics/init.go
index 0b24825..bced50d 100644
--- a/system/api/analytics/init.go
+++ b/system/api/analytics/init.go
@@ -197,9 +197,9 @@ func ChartData() (map[string]interface{}, error) {
}
// append request to requests for analysis if its timestamp is today
- // or its day is not already in cache
+ // and its day is not already in cache
d := time.Unix(r.Timestamp/1000, 0)
- if !d.Before(today) || m.Get([]byte(d.Format("01/02"))) != nil {
+ if !d.Before(today) && m.Get([]byte(d.Format("01/02"))) != nil {
requests = append(requests, r)
}
@@ -281,15 +281,15 @@ CHECK_REQUEST:
unique[i] = metrics[i].Unique
}
- k := dates[i]
- if b.Get([]byte(k)) == nil {
+ k := []byte(dates[i])
+ if b.Get(k) == nil {
if metrics[i].Total != 0 {
v, err := json.Marshal(metrics[i])
if err != nil {
return err
}
- err = b.Put([]byte(k), v)
+ err = b.Put(k, v)
if err != nil {
return err
}