mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-05-02 15:24:30 +02:00
debug log
This commit is contained in:
parent
de0b082810
commit
ab0d08b7a3
@ -106,7 +106,6 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
|
|||||||
config_yaml_path = os.path.join(CONFIG_DIR, "config.yaml")
|
config_yaml_path = os.path.join(CONFIG_DIR, "config.yaml")
|
||||||
if os.path.isfile(config_yaml_path):
|
if os.path.isfile(config_yaml_path):
|
||||||
try:
|
try:
|
||||||
log.info("Loading config.yaml")
|
|
||||||
with open(config_yaml_path, "r", encoding="utf-8") as f:
|
with open(config_yaml_path, "r", encoding="utf-8") as f:
|
||||||
config = yaml.load(f)
|
config = yaml.load(f)
|
||||||
if "net" not in config:
|
if "net" not in config:
|
||||||
@ -114,7 +113,7 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
|
|||||||
if os.getenv("SD_UI_BIND_PORT") is not None:
|
if os.getenv("SD_UI_BIND_PORT") is not None:
|
||||||
config["net"]["listen_port"] = int(os.getenv("SD_UI_BIND_PORT"))
|
config["net"]["listen_port"] = int(os.getenv("SD_UI_BIND_PORT"))
|
||||||
else:
|
else:
|
||||||
config['net']['listen_port'] = 9000
|
config["net"]["listen_port"] = 9000
|
||||||
if os.getenv("SD_UI_BIND_IP") is not None:
|
if os.getenv("SD_UI_BIND_IP") is not None:
|
||||||
config["net"]["listen_to_network"] = os.getenv("SD_UI_BIND_IP") == "0.0.0.0"
|
config["net"]["listen_to_network"] = os.getenv("SD_UI_BIND_IP") == "0.0.0.0"
|
||||||
else:
|
else:
|
||||||
@ -144,9 +143,9 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
|
|||||||
|
|
||||||
def setConfig(config):
|
def setConfig(config):
|
||||||
try: # config.yaml
|
try: # config.yaml
|
||||||
config_yaml_path = os.path.join(CONFIG_DIR, 'config.yaml')
|
config_yaml_path = os.path.join(CONFIG_DIR, "config.yaml")
|
||||||
yaml.indent(mapping=2, sequence=4, offset=2)
|
yaml.indent(mapping=2, sequence=4, offset=2)
|
||||||
with open(config_yaml_path, 'w', encoding='utf-8') as f:
|
with open(config_yaml_path, "w", encoding="utf-8") as f:
|
||||||
yaml.dump(config, f)
|
yaml.dump(config, f)
|
||||||
except:
|
except:
|
||||||
log.error(traceback.format_exc())
|
log.error(traceback.format_exc())
|
||||||
|
Loading…
Reference in New Issue
Block a user