Fixes #378: must acquire JID_CACHE_LOCK before adding to JID_CACHE
This commit is contained in:
parent
bb094cc649
commit
f54ebec654
@ -72,9 +72,8 @@ JID_CACHE_LOCK = threading.Lock()
|
||||
JID_CACHE_MAX_SIZE = 1024
|
||||
|
||||
def _cache(key, parts, locked):
|
||||
JID_CACHE[key] = (parts, locked)
|
||||
if len(JID_CACHE) > JID_CACHE_MAX_SIZE:
|
||||
with JID_CACHE_LOCK:
|
||||
JID_CACHE[key] = (parts, locked)
|
||||
while len(JID_CACHE) > JID_CACHE_MAX_SIZE:
|
||||
found = None
|
||||
for key, item in JID_CACHE.items():
|
||||
|
Loading…
Reference in New Issue
Block a user