3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

PyLinkNetworkCore: make deletion from self.users non-fatal

This commit is contained in:
James Lu 2018-04-20 19:37:22 -07:00
parent af744123e6
commit e96081aa6e

View File

@ -590,7 +590,11 @@ class PyLinkNetworkCore(structures.CamelCaseToSnakeCase):
sid = self.get_server(numeric) sid = self.get_server(numeric)
log.debug('Removing client %s from self.users', numeric) log.debug('Removing client %s from self.users', numeric)
del self.users[numeric] try:
del self.users[numeric]
except KeyError:
log.warning('(%s) Failed to remove %r from users index - possible desync or timing issue? (stray QUIT after KILL)',
self.name, numeric, exc_info=True)
log.debug('Removing client %s from self.servers[%s].users', numeric, sid) log.debug('Removing client %s from self.servers[%s].users', numeric, sid)
self.servers[sid].users.discard(numeric) self.servers[sid].users.discard(numeric)