Fixed asyncore hogging the CPU on disconnect. Although this really looks

like a bug in asyncore to me. o_O
This commit is contained in:
Stéphan Kochen 2004-04-12 21:53:49 +00:00
parent 03294c8686
commit bea41b308a

View File

@ -52,7 +52,12 @@ class AsyncoreRunnerDriver(drivers.IrcDriver):
def run(self):
#log.debug(repr(asyncore.socket_map))
try:
asyncore.poll(conf.supybot.drivers.poll())
timeout = conf.supybot.drivers.poll()
if len(asyncore.socket_map.keys()) < 1:
# FIXME: asyncore should take care of this... but it doesn't?
time.sleep(timeout)
else:
asyncore.poll(timeout)
except:
log.exception('Uncaught exception:')