forked from LimnoriaPlugins/SnoParser
Fixing timedelta
Signed-off-by: Georg <georg@lysergic.dev>
This commit is contained in:
parent
ee7c161067
commit
9a035edef3
@ -109,7 +109,7 @@ class SnoParser(callbacks.Plugin):
|
|||||||
self.redis_client_ips = self.redis_connect_ips()
|
self.redis_client_ips = self.redis_connect_ips()
|
||||||
|
|
||||||
def whois_fresh(self, sourceip: str) -> dict:
|
def whois_fresh(self, sourceip: str) -> dict:
|
||||||
"""Data from cache."""
|
"""Data from WHOIS backend (IANA or respective RIR)."""
|
||||||
asn = 0
|
asn = 0
|
||||||
subnet = ''
|
subnet = ''
|
||||||
try:
|
try:
|
||||||
@ -141,7 +141,7 @@ class SnoParser(callbacks.Plugin):
|
|||||||
def whois_set_cache(self, key: str, value: str) -> bool:
|
def whois_set_cache(self, key: str, value: str) -> bool:
|
||||||
"""Data to Redis."""
|
"""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,)
|
state = self.redis_client_whois.setex(key, timedelta(seconds=duration), value=value,)
|
||||||
return state
|
return state
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user