mirror of
https://github.com/evennia/evennia.git
synced 2026-03-17 05:16:31 +01:00
Remove sleep hack on startup, move so portal always starts before server.
This commit is contained in:
parent
5cfff771f2
commit
9d0baa2d5c
1 changed files with 9 additions and 15 deletions
|
|
@ -160,19 +160,7 @@ def start_services(server_argv, portal_argv):
|
|||
return
|
||||
queue.put(("portal_stopped", rc)) # this signals the controller that the program finished
|
||||
|
||||
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 is_pypy:
|
||||
# This is a hack; without it, the *server* stalls out and never finishes loading under PyPy.
|
||||
time.sleep(1)
|
||||
|
||||
try:
|
||||
if get_restart_mode(PORTAL_RESTART) == "True":
|
||||
# start portal as interactive, reloadable thread
|
||||
|
|
@ -180,13 +168,19 @@ def start_services(server_argv, portal_argv):
|
|||
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
|
||||
|
||||
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
|
||||
|
||||
# Reload loop
|
||||
while True:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue