first-run cache issue

This commit is contained in:
2020-05-15 01:48:26 -04:00
parent 05ef5b078c
commit f37d26572a
2 changed files with 4 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ class TunnelBroker(object):
ipr.close()
logger.debug('Set my_ip to {0}.'.format(self.my_ip.str))
chk_tuple = (datetime.datetime.utcnow(), self.my_ip)
if 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
if self.needs_update:
self.cached_ips.append(chk_tuple)