From 11c226833d78a6ae64d311b88b42e9fc588ce73a Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 11 Aug 2022 20:18:49 +0100 Subject: [PATCH] Add more LIST handling debugging --- core/bot.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/core/bot.py b/core/bot.py index b8f664f..c63e705 100644 --- a/core/bot.py +++ b/core/bot.py @@ -127,8 +127,10 @@ class IRCBot(IRCClient): error("%s - Cannot join channel we are already on: %s - %i" % (i, self.net, self.num)) def checkChannels(self): - if not chankeep.allRelaysActive(self.net): - debug("Skipping channel check as we have inactive relays: %s - %i" % (self.net, self.num)) + if chankeep.allRelaysActive(self.net): + debug(f"checkChannels() all relays active for {self.net}") + else: + debug("checkChannels() skipping channel check as we have inactive relays: %s - %i" % (self.net, self.num)) return if self.net in main.TempChan.keys(): if self.num in main.TempChan[self.net].keys(): @@ -457,24 +459,29 @@ class IRCBot(IRCClient): def recheckList(self): allRelays = chankeep.allRelaysActive(self.net) + debug(f"recheckList() all relays for {self.net} {allRelays}") if allRelays: - debug(f"All relays active for {self.net}") + debug(f"recheckList() all relays active for {self.net}") first_relay = helpers.get_first_relay(self.net) + debug(f"recheckList() first relay for {self.net}: {first_relay.num}") if first_relay: if first_relay.wantList is True: first_relay.list(nocheck=True) - debug("Asking for a list for %s after final relay %i connected" % (self.net, self.num)) + debug("recheckList() asking for a list for {self.net} after final relay {self.num} connected") # name = self.net + "1" # if self.num == 1: # Only one instance should do a list if helpers.is_first_relay(self.net, self.num): + debug(f"recheckList() we are the first relay for {self.net} ({self.num})") if self.chanlimit: if allRelays: self.list() + debug(f"recheckList() requested a list for {self.net} from {self.num}") + else: self.wantList = True else: - debug("Aborting LIST due to bad chanlimit") + debug("recheckList() aborting LIST due to bad chanlimit") self.checkChannels() def seed_chanlimit(self, chanlimit):