fix tll expiration check

This commit is contained in:
Radu Ioan Fericean
2016-08-16 17:39:50 +03:00
parent a326049084
commit 3db8800646
2 changed files with 2 additions and 2 deletions

View File

@@ -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()

View File

@@ -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)
}*/