mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-01-23 14:50:54 +01:00
Force move the old config.json to .bak, even if one exists. This is required for recovering from inconsistent states
This commit is contained in:
parent
fdc6a4d94b
commit
81a24249e6
@ -1,6 +1,7 @@
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import socket
|
||||
import sys
|
||||
import traceback
|
||||
@ -133,7 +134,7 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS):
|
||||
config = json.load(f)
|
||||
# Save config in new format
|
||||
setConfig(config)
|
||||
os.rename(config_json_path, config_json_path + ".bak")
|
||||
shutil.move(config_json_path, config_json_path + ".bak")
|
||||
log.info("Saved old config.json as config.json.bak")
|
||||
return getConfig(default_val)
|
||||
except Exception as e:
|
||||
|
Loading…
Reference in New Issue
Block a user