ensure we update if no cached IPs
This commit is contained in:
parent
a8475d9001
commit
c45754b1a3
@ -65,6 +65,8 @@ class TunnelBroker(object):
|
|||||||
chk_tuple = (datetime.datetime.utcnow(), self.my_ip)
|
chk_tuple = (datetime.datetime.utcnow(), self.my_ip)
|
||||||
if len(self.cached_ips) >= 1 and self.my_ip.str != self.cached_ips[-1][1].str:
|
if len(self.cached_ips) >= 1 and self.my_ip.str != self.cached_ips[-1][1].str:
|
||||||
self.needs_update = True
|
self.needs_update = True
|
||||||
|
elif len(self.cached_ips) == 0:
|
||||||
|
self.needs_update = True
|
||||||
if self.needs_update:
|
if self.needs_update:
|
||||||
self.cached_ips.append(chk_tuple)
|
self.cached_ips.append(chk_tuple)
|
||||||
with open(self.ip_cache, 'w') as fh:
|
with open(self.ip_cache, 'w') as fh:
|
||||||
|
Loading…
Reference in New Issue
Block a user