Fixing timedelta

Signed-off-by: Georg <georg@lysergic.dev>
This commit is contained in:
Georg Pfuetzenreuter 2021-08-27 15:55:27 +02:00
parent ee7c161067
commit 9a035edef3
Signed by: Georg
GPG Key ID: 1DAF57F49F8E8F22

View File

@ -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