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

relay: delay ENDBURST in spawnServer by 3 seconds (Closes #128)

This commit is contained in:
James Lu 2015-12-17 21:18:16 -08:00
parent 6b14a885bc
commit 00337fa783

View File

@ -187,10 +187,12 @@ def getRemoteSid(irc, remoteirc):
sid = relayservers[irc.name][remoteirc.name] sid = relayservers[irc.name][remoteirc.name]
except KeyError: except KeyError:
try: try:
# ENDBURST is delayed by 3 secs on supported IRCds to prevent
# triggering join-flood protection and the like.
sid = irc.proto.spawnServer('%s.relay' % remoteirc.name, sid = irc.proto.spawnServer('%s.relay' % remoteirc.name,
desc="PyLink Relay network - %s" % desc="PyLink Relay network - %s" %
(remoteirc.serverdata.get('netname')\ (remoteirc.serverdata.get('netname')\
or remoteirc.name)) or remoteirc.name), endburst_delay=3)
except ValueError: # Network not initialized yet. except ValueError: # Network not initialized yet.
log.exception('(%s) Failed to spawn server for %r:', log.exception('(%s) Failed to spawn server for %r:',
irc.name, remoteirc.name) irc.name, remoteirc.name)