mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
relay: use two locks (one for clients, one for servers) to prevent lock ups on start
This commit is contained in:
parent
16d8a2212a
commit
f2b6d1a3ad
@ -23,6 +23,7 @@ dbname += '.db'
|
||||
relayusers = defaultdict(dict)
|
||||
relayservers = defaultdict(dict)
|
||||
spawnlocks = defaultdict(threading.RLock)
|
||||
spawnlocks_servers = defaultdict(threading.RLock)
|
||||
savecache = ExpiringDict(max_len=5, max_age_seconds=10)
|
||||
killcache = ExpiringDict(max_len=5, max_age_seconds=10)
|
||||
|
||||
@ -143,7 +144,7 @@ def getPrefixModes(irc, remoteirc, channel, user, mlist=None):
|
||||
def getRemoteSid(irc, remoteirc):
|
||||
"""Gets the remote server SID representing remoteirc on irc, spawning
|
||||
it if it doesn't exist."""
|
||||
with spawnlocks[irc.name]:
|
||||
with spawnlocks_servers[irc.name]:
|
||||
try:
|
||||
sid = relayservers[irc.name][remoteirc.name]
|
||||
except KeyError:
|
||||
|
Loading…
Reference in New Issue
Block a user