fix redis preflight check

This commit is contained in:
checktheroads 2020-06-02 01:43:29 -07:00
parent a5b80b1d7e
commit 0d2deb49f9
3 changed files with 17 additions and 13 deletions

View file

@ -69,7 +69,7 @@ def build_frontend():
return build_ui()
@hg.command(
@hg.command( # noqa: C901
"start",
help=cmd_help(E.ROCKET, "Start web server", supports_color),
cls=HelpColorsCommand,
@ -103,18 +103,23 @@ def start(build, direct, workers):
if workers != 0:
kwargs["workers"] = workers
if build:
build_complete = build_ui()
try:
if build_complete and not direct:
if build:
build_complete = build_ui()
if build_complete and not direct:
start(**kwargs)
elif build_complete and direct:
uvicorn_start(**kwargs)
if not build and not direct:
start(**kwargs)
elif build_complete and direct:
elif not build and direct:
uvicorn_start(**kwargs)
if not build and not direct:
start(**kwargs)
elif not build and direct:
uvicorn_start(**kwargs)
except Exception as err:
error(str(err))
@hg.command(

View file

@ -103,9 +103,9 @@ def on_starting(server: Arbiter):
async def runner():
from asyncio import gather
await gather(check_redis_instance(), build_ui(), cache_config())
# await log.complete()
await gather(build_ui(), cache_config())
aiorun(check_redis_instance())
aiorun(runner())
log.success(
@ -124,7 +124,6 @@ def on_exit(server: Arbiter):
async def runner():
await clear_cache()
# await log.complete()
aiorun(runner())

View file

@ -520,7 +520,7 @@ async def build_frontend( # noqa: C901
migrate_static_assets(app_path)
except Exception as e:
raise RuntimeError(str(e))
raise RuntimeError(str(e)) from None
return True