From 7e156b262283985cbfe560317ec3d69d1bf19511 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 30 Jul 2013 11:14:53 -0400 Subject: Call clean on all networks periodically, generalize Topology clean cycle to an overall clean cycle. --- node/Node.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'node/Node.cpp') diff --git a/node/Node.cpp b/node/Node.cpp index 827af23b..9c748b4a 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -339,7 +339,7 @@ Node::ReasonForTermination Node::run() try { uint64_t lastPingCheck = 0; - uint64_t lastTopologyClean = Utils::now(); // don't need to do this immediately + uint64_t lastClean = Utils::now(); // don't need to do this immediately uint64_t lastNetworkFingerprintCheck = 0; uint64_t lastAutoconfigureCheck = 0; uint64_t networkConfigurationFingerprint = _r->sysEnv->getNetworkConfigurationFingerprint(); @@ -459,9 +459,10 @@ Node::ReasonForTermination Node::run() } } - if ((now - lastTopologyClean) >= ZT_TOPOLOGY_CLEAN_PERIOD) { - lastTopologyClean = now; - _r->topology->clean(); // happens in background + if ((now - lastClean) >= ZT_DB_CLEAN_PERIOD) { + lastClean = now; + _r->topology->clean(); + _r->nc->cleanAllNetworks(); } try { -- cgit v1.2.3