3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

relay: fix regression causing 'load relay' to freeze

This commit is contained in:
James Lu 2016-05-01 14:09:17 -07:00
parent 69cd3cfbf8
commit ab5624343b

View File

@ -49,15 +49,21 @@ def main(irc=None):
# Load the relay links database.
loadDB()
log.debug('relay.main: loading links database')
# Schedule periodic exports of the links database.
scheduleExport(starting=True)
log.debug('relay.main: scheduling export loop')
if irc is not None:
# irc is defined when the plugin is reloaded. Otherweise,
# it means that we've just started the server.
# Iterate over all known networks and initialize them.
# irc is defined when the plugin is reloaded. Otherwise, it means that we've just started the
# server. Iterate over all connected networks and initialize their relay users.
for ircobj in world.networkobjects.values():
initializeAll(ircobj)
if ircobj.connected.is_set():
initializeAll(ircobj)
log.debug('relay.main: finished initialization sequence')
def die(sourceirc):
"""Deinitialize PyLink Relay by quitting all relay clients and saving the