Redis: Ignore errors when unregistering connection fd at disconnection.

This commit is contained in:
Ask Solem 2014-11-09 16:19:23 +00:00
parent 0b4ee363f7
commit 323a08ab69
1 changed files with 4 additions and 3 deletions

View File

@ -255,9 +255,10 @@ class MultiChannelPoller(object):
self._channels.discard(channel)
def _on_connection_disconnect(self, connection):
sock = getattr(connection, '_sock', None)
if sock is not None:
self.poller.unregister(sock)
try:
self.poller.unregister(connection._sock)
except (AttributeError, TypeError):
pass
def _register(self, channel, client, type):
if (channel, client, type) in self._chan_to_sock: