From 0e708f4b266f6b31bba6a79f6539171f681d62e2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 25 Aug 2017 09:24:21 -0400 Subject: [PATCH] Back off https recheck With various fixes, it does not make as much sense to be so aggressive with rechecking https assuming we sense something prior to https being up. --- confluent_server/confluent/discovery/core.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/confluent_server/confluent/discovery/core.py b/confluent_server/confluent/discovery/core.py index 130f99f8..963ef62e 100644 --- a/confluent_server/confluent/discovery/core.py +++ b/confluent_server/confluent/discovery/core.py @@ -447,12 +447,12 @@ def _recheck_single_unknown(configmanager, mac): 'https, will examine later'.format( handler.devname, info['hwaddr'], handler.ipaddr )}) - if rechecker is not None and rechecktime > util.monotonic_time() + 60: + if rechecker is not None and rechecktime > util.monotonic_time() + 300: rechecker.cancel() # if cancel did not result in dead, then we are in progress if rechecker is None or rechecker.dead: - rechecktime = util.monotonic_time() + 60 - rechecker = eventlet.spawn_after(60, _periodic_recheck, + rechecktime = util.monotonic_time() + 300 + rechecker = eventlet.spawn_after(300, _periodic_recheck, configmanager) return nodename = get_nodename(configmanager, handler, info) @@ -556,11 +556,11 @@ def detected(info): 'https, will examine later'.format( handler.devname, info['hwaddr'], handler.ipaddr )}) - if rechecker is not None and rechecktime > util.monotonic_time() + 60: + if rechecker is not None and rechecktime > util.monotonic_time() + 240: rechecker.cancel() if rechecker is None or rechecker.dead: - rechecktime = util.monotonic_time() + 60 - rechecker = eventlet.spawn_after(60, _periodic_recheck, cfg) + rechecktime = util.monotonic_time() + 240 + rechecker = eventlet.spawn_after(240, _periodic_recheck, cfg) unknown_info[info['hwaddr']] = info info['discostatus'] = 'unidentfied' #TODO, eventlet spawn after to recheck sooner, or somehow else