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:
OHMURA Kei 2013-03-22 14:29:35 +09:00 committed by FUJITA Tomonori
parent 322e0cfc9e
commit 734133612b
1 changed files with 4 additions and 2 deletions

View File

@ -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__":