Add more LIST handling debugging

Mark Veidemanis 2 years ago
parent 87ee96dd26
commit 604bee1b78

@ -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):

Loading…
Cancel
Save