From dc13515aa87fc0f395f371525ec7cf419c869518 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 11 Aug 2022 20:36:24 +0100 Subject: [PATCH] Adding more debug statements in ECA system --- modules/chankeep.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/chankeep.py b/modules/chankeep.py index 740482f..d46e7fd 100644 --- a/modules/chankeep.py +++ b/modules/chankeep.py @@ -71,6 +71,7 @@ def emptyChanAllocate(net, flist, relay, new): toalloc = len(flist) if toalloc > sum(chanfree[0].values()): correction = round(toalloc - sum(chanfree[0].values()) / chanfree[1]) + debug(f"emptyChanAllocate() not enough free channels: toalloc:{toalloc} free:{chanfree[0]} chanlimit:{chanfree[1]} correction:{correction}") warn("Ran out of channel spaces, provisioning additional %i relays for %s" % (correction, net)) modules.provision.provisionMultipleRelays(net, correction) return False @@ -133,11 +134,13 @@ def keepChannels(net, listinfo, mean, sigrelay, relay): return if coverAll: needed = relay - len(getActiveRelays(net)) + debug(f"keepChannels() coverAll asking to provision {needed} relays for {net} relay:{relay}") newNums = modules.provision.provisionMultipleRelays(net, needed) flist = [i[0] for i in listinfo] populateChans(net, flist, relay, newNums) else: needed = sigrelay - len(getActiveRelays(net)) + debug(f"keepChannels() NOT coverAll asking to provision {needed} relays for {net} sigrelay:{sigrelay}") newNums = modules.provision.provisionMultipleRelays(net, needed) siglist = [i[0] for i in listinfo if int(i[1]) > mean] populateChans(net, siglist, sigrelay, newNums)