supress exceptions if client is stopped

pull/34/head
Zlatin Balevsky 2019-12-24 17:05:36 +00:00
parent e6d59a2438
commit 8f9b1e5a8b
1 changed files with 6 additions and 1 deletions

View File

@ -71,7 +71,12 @@ class CacheClient {
options.setSendLeaseSet(true)
CacheServers.getCacheServers().each {
log.info "Querying hostcache ${it.toBase32()}"
session.sendMessage(it, ping, 0, ping.length, I2PSession.PROTO_DATAGRAM, 1, 0, options)
try {
session.sendMessage(it, ping, 0, ping.length, I2PSession.PROTO_DATAGRAM, 1, 0, options)
} catch (Exception e) {
if (!stopped.get())
throw e
}
}
}