Commit 105c1f62 by Sheng

Close handler with reason why worker closed

parent 9b38d111
......@@ -94,11 +94,11 @@ class Worker(object):
def close(self, reason=None):
logging.info(
'Closing worker {} with reason {}'.format(self.id, reason)
'Closing worker {} with reason: {}'.format(self.id, reason)
)
if self.handler:
self.loop.remove_handler(self.fd)
self.handler.close()
self.handler.close(reason=reason)
self.chan.close()
self.ssh.close()
logging.info('Connection to {}:{} lost'.format(*self.dst_addr))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment