Fix failure cache cleanup

This commit is contained in:
rkfg 2022-08-20 22:32:26 +03:00
parent a3ce2794d1
commit 69b4af0fe0

View File

@ -168,7 +168,7 @@ func (r *regolancer) addFailedRoute(from, to uint64) {
t := time.Now().Add(time.Hour)
r.failureCache[fmt.Sprintf("%d-%d", from, to)] = &t
for k, v := range r.failureCache {
if v.After(time.Now()) {
if v.Before(time.Now()) {
delete(r.failureCache, k)
}
}