mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 09:19:23 +01:00
relay: restore checks for irc.connected/world.started to prevent server spawning from happening too quickly
This commit is contained in:
parent
ffce69060c
commit
07694ae642
@ -32,6 +32,10 @@ relay_started = True
|
|||||||
|
|
||||||
def initializeAll(irc):
|
def initializeAll(irc):
|
||||||
"""Initializes all relay channels for the given IRC object."""
|
"""Initializes all relay channels for the given IRC object."""
|
||||||
|
# Wait for all IRC objects to initialize first. This prevents
|
||||||
|
# relay servers from being spawned too early (before server authentication),
|
||||||
|
# which would break connections.
|
||||||
|
world.started.wait(2)
|
||||||
for chanpair, entrydata in db.items():
|
for chanpair, entrydata in db.items():
|
||||||
network, channel = chanpair
|
network, channel = chanpair
|
||||||
initializeChannel(irc, channel)
|
initializeChannel(irc, channel)
|
||||||
@ -164,6 +168,8 @@ def getPrefixModes(irc, remoteirc, channel, user, mlist=None):
|
|||||||
def getRemoteSid(irc, remoteirc):
|
def getRemoteSid(irc, remoteirc):
|
||||||
"""Gets the remote server SID representing remoteirc on irc, spawning
|
"""Gets the remote server SID representing remoteirc on irc, spawning
|
||||||
it if it doesn't exist."""
|
it if it doesn't exist."""
|
||||||
|
# Don't spawn servers too early.
|
||||||
|
irc.connected.wait(2)
|
||||||
try:
|
try:
|
||||||
spawnservers = irc.conf['relay']['spawn_servers']
|
spawnservers = irc.conf['relay']['spawn_servers']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
Reference in New Issue
Block a user