Some minor fixes and cleanups in runner.py.
This commit is contained in:
parent
c301ec4922
commit
9921d9b28c
1 changed files with 21 additions and 12 deletions
|
|
@ -152,13 +152,19 @@ def start_services(server_argv, portal_argv):
|
||||||
rc = Popen(portal_argv).wait()
|
rc = Popen(portal_argv).wait()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "Portal process error: %(e)s" % {'e': e}
|
print "Portal process error: %(e)s" % {'e': e}
|
||||||
|
return
|
||||||
queue.put(("portal_stopped", rc)) # this signals the controller that the program finished
|
queue.put(("portal_stopped", rc)) # this signals the controller that the program finished
|
||||||
|
|
||||||
|
try:
|
||||||
if server_argv:
|
if server_argv:
|
||||||
# start server as a reloadable thread
|
# start server as a reloadable thread
|
||||||
SERVER = thread.start_new_thread(server_waiter, (processes, ))
|
SERVER = thread.start_new_thread(server_waiter, (processes, ))
|
||||||
|
except IOError, e:
|
||||||
|
print "Server IOError: %s\nA possible explanation for this is that 'twistd' is not found." % e
|
||||||
|
return
|
||||||
|
|
||||||
if portal_argv:
|
if portal_argv:
|
||||||
|
try:
|
||||||
if get_restart_mode(PORTAL_RESTART):
|
if get_restart_mode(PORTAL_RESTART):
|
||||||
# start portal as interactive, reloadable thread
|
# start portal as interactive, reloadable thread
|
||||||
PORTAL = thread.start_new_thread(portal_waiter, (processes, ))
|
PORTAL = thread.start_new_thread(portal_waiter, (processes, ))
|
||||||
|
|
@ -168,6 +174,9 @@ def start_services(server_argv, portal_argv):
|
||||||
if not SERVER:
|
if not SERVER:
|
||||||
# if portal is daemon and no server is running, we have no reason to continue to the loop.
|
# if portal is daemon and no server is running, we have no reason to continue to the loop.
|
||||||
return
|
return
|
||||||
|
except IOError, e:
|
||||||
|
print "Portal IOError: %s\nA possible explanation for this is that 'twistd' is not found." % e
|
||||||
|
return
|
||||||
|
|
||||||
# Reload loop
|
# Reload loop
|
||||||
while True:
|
while True:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue