From 75724797f74a82ce3a55053c9272f930836fcee3 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Wed, 16 Nov 2022 12:20:25 +0530 Subject: [PATCH] Don't show a 500 error when the config json file doesn't exist --- ui/server.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ui/server.py b/ui/server.py index f47d9227..bcbcf038 100644 --- a/ui/server.py +++ b/ui/server.py @@ -228,7 +228,7 @@ def read_web_data(key:str=None): elif key == 'app_config': config = getConfig(default_val=None) if config is None: - raise HTTPException(status_code=500, detail="Config file is missing or unreadable") + config = APP_CONFIG_DEFAULTS return JSONResponse(config, headers=NOCACHE_HEADERS) elif key == 'devices': config = getConfig() @@ -376,10 +376,7 @@ task_manager.default_vae_to_load = resolve_vae_to_use() def update_render_threads(): config = getConfig() - if 'render_devices' in config: - render_devices = config['render_devices'] - else: - render_devices = 'auto' + render_devices = config.get('render_devices', 'auto') active_devices = task_manager.get_devices()['active'].keys() print('requesting for render_devices', render_devices)