提交 4417c5d0 编写于 作者: L liangyongxiong

1) print workspace path on startup; 2) update gunicorn configuration

上级 2f28388b
......@@ -30,7 +30,7 @@ worker_connections = 1000
timeout = 30
graceful_timeout = 30
daemon = True
daemon = False
captureoutput = True
......
......@@ -22,7 +22,6 @@ import shlex
from gunicorn.glogging import Logger
from mindinsight.backend.config import gunicorn_conf
from mindinsight.backend.config import WEB_CONFIG_DIR
from mindinsight.conf import settings
from mindinsight.utils.log import setup_logger
......@@ -241,12 +240,16 @@ def start():
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
_, stderr = process.communicate()
if stderr:
console.error(stderr.decode())
# wait command success to end when gunicorn running in daemon.
if gunicorn_conf.daemon and process.wait() == 0:
# sleep 1 second for gunicorn appplication to load modules
time.sleep(1)
# check if gunicorn application is running
if process.poll() is not None:
_, stderr = process.communicate()
for line in stderr.decode().split('\n'):
console.error(line)
else:
state_result = _check_server_start_stat(errorlog_abspath, log_size)
# print gunicorn start state to stdout
console.info('Web address: http://%s:%s', settings.HOST, settings.PORT)
......
......@@ -193,6 +193,8 @@ class Command(BaseCommand):
self.logfile.error(error.message)
sys.exit(1)
self.console.info('Workspace: %s', os.path.realpath(settings.WORKSPACE))
run_module = import_module('mindinsight.backend.run')
run_module.start()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册