regex-cleanup #19

Merged
pratyush merged 19 commits from regex-cleanup into master 2023-05-03 13:01:49 +02:00
Showing only changes of commit 9a035edef3 - Show all commits

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