mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-02-11 16:12:14 +01:00
Error reporting while starting the post-installation browser; Temp hack
This commit is contained in:
parent
e804247acb
commit
cabf4a4f07
@ -102,6 +102,8 @@ def start_backend():
|
|||||||
install_backend()
|
install_backend()
|
||||||
|
|
||||||
was_still_installing = not is_installed()
|
was_still_installing = not is_installed()
|
||||||
|
print(f"was_still_installing = {was_still_installing}")
|
||||||
|
was_still_installing = True
|
||||||
|
|
||||||
if backend_config.get("auto_update", True):
|
if backend_config.get("auto_update", True):
|
||||||
run_in_conda(["git", "add", "-A", "."], cwd=WEBUI_DIR)
|
run_in_conda(["git", "add", "-A", "."], cwd=WEBUI_DIR)
|
||||||
@ -128,7 +130,10 @@ def start_backend():
|
|||||||
try:
|
try:
|
||||||
impl.ping(timeout=1)
|
impl.ping(timeout=1)
|
||||||
|
|
||||||
if was_still_installing and not has_started: # first start
|
is_first_start = not has_started
|
||||||
|
has_started = True
|
||||||
|
|
||||||
|
if was_still_installing and is_first_start:
|
||||||
ui = config.get("ui", {})
|
ui = config.get("ui", {})
|
||||||
|
|
||||||
if ui.get("open_browser_on_start", True):
|
if ui.get("open_browser_on_start", True):
|
||||||
@ -137,8 +142,6 @@ def start_backend():
|
|||||||
log.info("Opening browser..")
|
log.info("Opening browser..")
|
||||||
|
|
||||||
webbrowser.open(f"http://localhost:{port}")
|
webbrowser.open(f"http://localhost:{port}")
|
||||||
|
|
||||||
has_started = True
|
|
||||||
except (TimeoutError, ConnectionError):
|
except (TimeoutError, ConnectionError):
|
||||||
if has_started: # process probably died
|
if has_started: # process probably died
|
||||||
print("######################## WebUI probably died. Restarting...")
|
print("######################## WebUI probably died. Restarting...")
|
||||||
@ -147,7 +150,9 @@ def start_backend():
|
|||||||
backend_thread.start()
|
backend_thread.start()
|
||||||
break
|
break
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
import traceback
|
||||||
|
|
||||||
|
log.exception(traceback.format_exc())
|
||||||
|
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user