diff --git a/cache2go/lruttl.go b/cache2go/lruttl.go index 21f0de87d..6603fb571 100644 --- a/cache2go/lruttl.go +++ b/cache2go/lruttl.go @@ -58,7 +58,7 @@ func (c *Cache) cleanExpired() { c.mu.RUnlock() en := e.Value.(*entry) - if en.timestamp.Add(c.expiration).After(time.Now()) { + if time.Now().After(en.timestamp.Add(c.expiration)) { c.mu.Lock() c.removeElement(e) c.mu.Unlock() diff --git a/engine/loader_csv_test.go b/engine/loader_csv_test.go index 35500f36a..612d8a4ca 100644 --- a/engine/loader_csv_test.go +++ b/engine/loader_csv_test.go @@ -810,7 +810,7 @@ func TestLoadRatingPlans(t *testing.T) { }, } if !reflect.DeepEqual(rplan.Ratings, expected.Ratings) { - t.Errorf("Error loading destination rate timing: %+v", rplan.Ratings) + t.Errorf("Error loading destination rate timing: %+v", utils.ToIJSON(rplan.Ratings)) /*for tag, key := range rplan.Ratings { log.Print(tag, key) }*/