first-run cache issue
This commit is contained in:
parent
05ef5b078c
commit
f37d26572a
@ -266,7 +266,9 @@ class HETunnelConfig(HEBaseConfig):
|
|||||||
self.my_ip = None # Client IPv4 (not necessary; we locally cache Tunnel.my_ip)
|
self.my_ip = None # Client IPv4 (not necessary; we locally cache Tunnel.my_ip)
|
||||||
self.allocations = {} # keys are 64 and 48
|
self.allocations = {} # keys are 64 and 48
|
||||||
self.rdns = [] # Also not necessary, but it's in the XML so why not.
|
self.rdns = [] # Also not necessary, but it's in the XML so why not.
|
||||||
self.tun_xml = self.xml.find('tunnel') # Will only return a single <tunnel> for this URL.
|
# Will only return a single <tunnel> for this URL.
|
||||||
|
# TODO: I can probably consolidate all this into HECond instead?
|
||||||
|
self.tun_xml = self.xml.find('tunnel')
|
||||||
self.parse()
|
self.parse()
|
||||||
|
|
||||||
def _alloc(self):
|
def _alloc(self):
|
||||||
|
@ -63,7 +63,7 @@ class TunnelBroker(object):
|
|||||||
ipr.close()
|
ipr.close()
|
||||||
logger.debug('Set my_ip to {0}.'.format(self.my_ip.str))
|
logger.debug('Set my_ip to {0}.'.format(self.my_ip.str))
|
||||||
chk_tuple = (datetime.datetime.utcnow(), self.my_ip)
|
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
|
self.needs_update = True
|
||||||
if self.needs_update:
|
if self.needs_update:
|
||||||
self.cached_ips.append(chk_tuple)
|
self.cached_ips.append(chk_tuple)
|
||||||
|
Loading…
Reference in New Issue
Block a user