ensure we update if no cached IPs

This commit is contained in:
brent s. 2020-05-15 01:53:37 -04:00
parent a8475d9001
commit c45754b1a3
Signed by: bts
GPG Key ID: 8C004C2F93481F6B
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,8 @@ class TunnelBroker(object):
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:
self.needs_update = True
elif len(self.cached_ips) == 0:
self.needs_update = True
if self.needs_update:
self.cached_ips.append(chk_tuple)
with open(self.ip_cache, 'w') as fh: