Commit 20ba6bad by Sheng

Enhanced

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