From 4e6c90b98c1d3d6bd340de07d1ed6193ff1b2f51 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Thu, 22 Oct 2020 09:34:53 +0100 Subject: [PATCH] try to fix purging of old entries within the same day --- .../main/groovy/com/muwire/core/hostcache/H2HostCache.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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") }