diff --git a/respodns/ip_info.py b/respodns/ip_info.py index 365a2a8..b22af89 100644 --- a/respodns/ip_info.py +++ b/respodns/ip_info.py @@ -72,7 +72,6 @@ class IpInfoByIpApi(IpInfoBase): if x_remaining == 0: self.cooldown = time() + x_cooldown - self.cooldown += 1.0 # still too frequent according to them return None # no error @@ -85,7 +84,8 @@ class IpInfoByIpApi(IpInfoBase): # for the duration of X-Ttl in seconds. while time() < self.cooldown: wait = self.cooldown - time() - wait = max(wait, 0.1) # wait at least a little bit + wait = max(0, wait) # must not be negative! + wait += 0.1 # still too frequent according to them await sleep(wait) async def http_lookup(self, ip):