mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
Actually do negative caching on failed discovery lookups (fixes #2434)
This commit is contained in:
parent
07d53be9fc
commit
58523060f0
@ -109,6 +109,12 @@ func (m *CachingMux) Lookup(deviceID protocol.DeviceID) (direct []string, relays
|
||||
when: time.Now(),
|
||||
found: len(td)+len(tr) > 0,
|
||||
})
|
||||
} else {
|
||||
// Lookup returned error, add a negative cache entry.
|
||||
m.caches[i].Set(deviceID, CacheEntry{
|
||||
when: time.Now(),
|
||||
found: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
m.mut.Unlock()
|
||||
|
Loading…
Reference in New Issue
Block a user