add optimistic profiles to newly discovered hosts

pull/53/head
Zlatin Balevsky 2020-10-20 18:15:10 +01:00
parent a725837769
commit b1f58b0948
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 2 additions and 1 deletions

View File

@ -40,12 +40,13 @@ class H2HostCache extends HostCache {
@Override
protected synchronized void hostDiscovered(Destination d, boolean fromHostcache) {
// overwrite MC with optimistic values
if (fromHostcache) {
// overwrite MC with optimistic values
sql.execute("delete from HOST_ATTEMPTS where DESTINATION='${d.toBase64()}';")
profiles.put(d, new HostMCProfile())
} else if (uniqueHosts.add(d)) {
allHosts.add(d)
profiles.put(d, new HostMCProfile())
}
}