ryu-manager: use try-finally statement
This fixes a problem that app_mgr.close() is not called when KeyboardInterrupt exception occurs. Signed-off-by: OHMURA Kei <ohmura.kei@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
322e0cfc9e
commit
734133612b
|
@ -77,8 +77,10 @@ def main():
|
|||
thr = gevent.spawn_later(0, webapp)
|
||||
services.append(thr)
|
||||
|
||||
gevent.joinall(services)
|
||||
app_mgr.close()
|
||||
try:
|
||||
gevent.joinall(services)
|
||||
finally:
|
||||
app_mgr.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in New Issue