forked from mirrors/thatmattlove-hyperglass
fix redis preflight check
This commit is contained in:
parent
a5b80b1d7e
commit
0d2deb49f9
3 changed files with 17 additions and 13 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue