diff --git a/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy b/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy index c83b181b..be6f06fa 100644 --- a/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy +++ b/core/src/main/groovy/com/muwire/core/hostcache/H2HostCache.groovy @@ -164,7 +164,8 @@ class H2HostCache extends HostCache { if (rows.size() < settings.hostProfileHistory) return - def lastTstamp = rows[settings.hostProfileHistory - 1].TSTAMP + def lastTstamp = rows[settings.hostProfileHistory - 1].TSTAMP + lastTimestamp = SDF.format(new Date(lastTstamp.getTime())) sql.execute("delete from HOST_ATTEMPTS where DESTINATION=${d.toBase64()} and TSTAMP < $lastTstamp") log.fine("deleted $sql.updateCount old attempts older than $lastTstamp") }