add exception handler in case preload breaks?

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
pull/37/head
Victor Seiji Hariki 2023-01-24 19:44:30 -03:00
parent 4ebdc9acc0
commit 20a3397e97
2 changed files with 17 additions and 6 deletions

View File

@ -3,3 +3,4 @@ import argparse
def preload(parser: argparse.ArgumentParser):
parser.add_argument("--lock-oo-submodule", action='store_true',
help="(openOutpaint-webUI-extension) Prevent checking for main openOutpaint submodule updates.")

View File

@ -49,11 +49,21 @@ def started(demo, app: FastAPI):
pass
def add_tab():
if (not shared.cmd_opts.lock_oo_submodule):
def update_app():
git = os.environ.get('GIT', "git")
run(f'"{git}" -C "' + scripts.basedir() +
'" submodule update --init --recursive --remote')
def add_tab():
try:
if shared.cmd_opts.lock_oo_submodule:
print(f"[openOutpaint] Submodule locked. Will skip submodule update.")
else:
update_app()
except Exception:
update_app()
with gr.Blocks(analytics_enabled=False) as ui:
#refresh = gr.Button(value="refresh", variant="primary")
canvas = gr.HTML(