Merge "Removing wait() when initializing notification listener"

This commit is contained in:
Jenkins 2015-11-15 08:22:13 +00:00 committed by Gerrit Code Review
commit ade1d89172
2 changed files with 39 additions and 8 deletions

View File

@ -25,6 +25,7 @@ eventlet.monkey_patch(
time=True)
import os
import time
# If ../mistral/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
@ -76,7 +77,15 @@ def launch_executor(transport):
executor_v2.register_membership()
try:
server.start()
while True:
time.sleep(604800)
except (KeyboardInterrupt, SystemExit):
pass
finally:
print("Stopping executor service...")
server.stop()
server.wait()
@ -107,7 +116,15 @@ def launch_engine(transport):
engine_v2.register_membership()
try:
server.start()
while True:
time.sleep(604800)
except (KeyboardInterrupt, SystemExit):
pass
finally:
print("Stopping engine service...")
server.stop()
server.wait()

View File

@ -44,7 +44,14 @@ def launch_engine_server(transport, engine):
serializer=ctx.RpcContextSerializer(ctx.JsonPayloadSerializer())
)
try:
server.start()
while True:
eventlet.sleep(604800)
except (KeyboardInterrupt, SystemExit):
LOG.info("Stopping engine service...")
finally:
server.stop()
server.wait()
@ -62,7 +69,14 @@ def launch_executor_server(transport, executor):
serializer=ctx.RpcContextSerializer(ctx.JsonPayloadSerializer())
)
try:
server.start()
while True:
eventlet.sleep(604800)
except (KeyboardInterrupt, SystemExit):
LOG.info("Stopping executor service...")
finally:
server.stop()
server.wait()