From 9a035edef35d10d5c477a2ec7660d0c69e96729a Mon Sep 17 00:00:00 2001 From: Georg Date: Fri, 27 Aug 2021 15:55:27 +0200 Subject: [PATCH] Fixing timedelta Signed-off-by: Georg --- plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index 4b16961..1adf2ef 100644 --- a/plugin.py +++ b/plugin.py @@ -109,7 +109,7 @@ class SnoParser(callbacks.Plugin): self.redis_client_ips = self.redis_connect_ips() def whois_fresh(self, sourceip: str) -> dict: - """Data from cache.""" + """Data from WHOIS backend (IANA or respective RIR).""" asn = 0 subnet = '' try: @@ -141,7 +141,7 @@ class SnoParser(callbacks.Plugin): def whois_set_cache(self, key: str, value: str) -> bool: """Data to Redis.""" - duration = self.registryValue('whois.ttl') + duration = int(self.registryValue('whois.ttl')) state = self.redis_client_whois.setex(key, timedelta(seconds=duration), value=value,) return state