Fix getting first relay when they are not sequential
This commit is contained in:
parent
4f4820818a
commit
d7adffb47f
|
@ -138,7 +138,7 @@ def getActiveRelays(net):
|
|||
# )
|
||||
if main.IRCPool[name].authenticated and main.IRCPool[name].isconnected:
|
||||
activeRelays.append(i)
|
||||
# debug(f"getActiveRelays() {net}: {activeRelays}")
|
||||
debug(f"getActiveRelays() {net}: {activeRelays}")
|
||||
return activeRelays
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import main
|
||||
from modules import chankeep
|
||||
|
||||
# from utils.logging.debug import debug
|
||||
from utils.logging.debug import debug
|
||||
|
||||
|
||||
def get_first_relay(net):
|
||||
|
@ -12,10 +12,11 @@ def get_first_relay(net):
|
|||
:return: IRCPool instance for the IRC bot
|
||||
"""
|
||||
cur_relay = 0
|
||||
max_relay = len(main.network[net].relays.keys()) + 1
|
||||
# debug(f"get_first_relay() {net}: max_relay:{max_relay}")
|
||||
max_relay = max(main.network[net].relays.keys())
|
||||
debug(f"get_first_relay() {net}: max_relay:{max_relay}")
|
||||
activeRelays = chankeep.getActiveRelays(net)
|
||||
# debug(f"get_first_relay() {net}: activeRelays:{activeRelays}")
|
||||
|
||||
debug(f"get_first_relay() {net}: activeRelays:{activeRelays}")
|
||||
while cur_relay != max_relay:
|
||||
cur_relay += 1
|
||||
if cur_relay not in activeRelays:
|
||||
|
|
Loading…
Reference in New Issue