Commit 20ba6bad by Sheng

Enhanced

parent 715d5090
......@@ -229,8 +229,8 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
try:
worker = self.ssh_connect()
except Exception as exc:
logging.error(traceback.format_exc())
future.set_exception(exc)
raise exc
else:
future.set_result(worker)
......@@ -243,16 +243,15 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
status = None
future = Future()
try:
threading.Thread(
target=self.ssh_connect_wrapped, args=(future,)
).start()
yield future
try:
worker = yield future
except Exception as exc:
logging.error(traceback.format_exc())
status = str(exc)
else:
worker = future.result()
worker.src_addr = self.get_client_addr()
worker_id = worker.id
workers[worker_id] = worker
......
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