3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

relay: remove unnecessary "Relay plugin unloaded" quits

This commit is contained in:
James Lu 2016-07-24 11:13:51 -07:00
parent dc364b3e9e
commit 832f22e7f0

View File

@ -68,24 +68,19 @@ def die(sourceirc):
# For every connected network: # For every connected network:
for irc in world.networkobjects.values(): for irc in world.networkobjects.values():
# 1) Find all the relay clients and quit them. # 1) SQUIT every relay subserver.
for user in irc.users.copy():
if isRelayClient(irc, user):
irc.proto.quit(user, "Relay plugin unloaded.")
# 2) SQUIT every relay subserver.
for server, sobj in irc.servers.copy().items(): for server, sobj in irc.servers.copy().items():
if hasattr(sobj, 'remote'): if hasattr(sobj, 'remote'):
irc.proto.squit(irc.sid, server, text="Relay plugin unloaded.") irc.proto.squit(irc.sid, server, text="Relay plugin unloaded.")
# 3) Clear our internal servers and users caches. # 2) Clear our internal servers and users caches.
relayservers.clear() relayservers.clear()
relayusers.clear() relayusers.clear()
# 4) Export the relay links database. # 3) Export the relay links database.
exportDB() exportDB()
# 5) Kill the scheduling for any other exports. # 4) Kill the scheduling for any other exports.
global exportdb_timer global exportdb_timer
if exportdb_timer: if exportdb_timer:
log.debug("Relay: cancelling exportDB timer thread %s due to die()", threading.get_ident()) log.debug("Relay: cancelling exportDB timer thread %s due to die()", threading.get_ident())