mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-05-30 14:49:55 +02:00
Rename method
This commit is contained in:
parent
db55064bb2
commit
df655eb2d7
@ -110,7 +110,7 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
|
|||||||
if os.path.isfile(config_legacy_yaml):
|
if os.path.isfile(config_legacy_yaml):
|
||||||
shutil.move(config_legacy_yaml, config_yaml_path)
|
shutil.move(config_legacy_yaml, config_yaml_path)
|
||||||
|
|
||||||
def set_default_config(config: dict):
|
def set_config_on_startup(config: dict):
|
||||||
if (getConfig.__config_on_startup is None):
|
if (getConfig.__config_on_startup is None):
|
||||||
getConfig.__config_on_startup = copy.deepcopy(config)
|
getConfig.__config_on_startup = copy.deepcopy(config)
|
||||||
config["config_on_startup"] = getConfig.__config_on_startup
|
config["config_on_startup"] = getConfig.__config_on_startup
|
||||||
@ -131,12 +131,12 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
|
|||||||
else:
|
else:
|
||||||
config["net"]["listen_to_network"] = True
|
config["net"]["listen_to_network"] = True
|
||||||
|
|
||||||
set_default_config(config)
|
set_config_on_startup(config)
|
||||||
|
|
||||||
return config
|
return config
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warn(traceback.format_exc())
|
log.warn(traceback.format_exc())
|
||||||
set_default_config(default_val)
|
set_config_on_startup(default_val)
|
||||||
return default_val
|
return default_val
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@ -157,7 +157,7 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
|
|||||||
return getConfig(default_val)
|
return getConfig(default_val)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.warn(traceback.format_exc())
|
log.warn(traceback.format_exc())
|
||||||
set_default_config(default_val)
|
set_config_on_startup(default_val)
|
||||||
return default_val
|
return default_val
|
||||||
|
|
||||||
getConfig.__config_on_startup = None
|
getConfig.__config_on_startup = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user