mirror of
https://github.com/evennia/evennia.git
synced 2026-03-25 09:16:32 +01:00
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,22 +152,31 @@ def start_services(server_argv, portal_argv):
|
|||
rc = Popen(portal_argv).wait()
|
||||
except Exception, e:
|
||||
print "Portal process error: %(e)s" % {'e': e}
|
||||
return
|
||||
queue.put(("portal_stopped", rc)) # this signals the controller that the program finished
|
||||
|
||||
if server_argv:
|
||||
# start server as a reloadable thread
|
||||
SERVER = thread.start_new_thread(server_waiter, (processes, ))
|
||||
try:
|
||||
if server_argv:
|
||||
# start server as a reloadable thread
|
||||
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 get_restart_mode(PORTAL_RESTART):
|
||||
# start portal as interactive, reloadable thread
|
||||
PORTAL = thread.start_new_thread(portal_waiter, (processes, ))
|
||||
else:
|
||||
# normal operation: start portal as a daemon; we don't care to monitor it for restart
|
||||
PORTAL = Popen(portal_argv)
|
||||
if not SERVER:
|
||||
# if portal is daemon and no server is running, we have no reason to continue to the loop.
|
||||
return
|
||||
try:
|
||||
if get_restart_mode(PORTAL_RESTART):
|
||||
# start portal as interactive, reloadable thread
|
||||
PORTAL = thread.start_new_thread(portal_waiter, (processes, ))
|
||||
else:
|
||||
# normal operation: start portal as a daemon; we don't care to monitor it for restart
|
||||
PORTAL = Popen(portal_argv)
|
||||
if not SERVER:
|
||||
# if portal is daemon and no server is running, we have no reason to continue to the loop.
|
||||
return
|
||||
except IOError, e:
|
||||
print "Portal IOError: %s\nA possible explanation for this is that 'twistd' is not found." % e
|
||||
return
|
||||
|
||||
# Reload loop
|
||||
while True:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue