gracefully handle missing appconfig by creating default settings in elasticsearch (#983)
Co-authored-by: skillet <skillet@localhost>
This commit is contained in:
parent
8a227fc9b8
commit
b239f4bd84
@ -201,7 +201,15 @@ class ElasitIndexWrap:
|
|||||||
if self.backup_run:
|
if self.backup_run:
|
||||||
return
|
return
|
||||||
|
|
||||||
config = AppConfig().config
|
try:
|
||||||
|
config = AppConfig().config
|
||||||
|
except ValueError:
|
||||||
|
# create defaults in ES if config not found
|
||||||
|
print("AppConfig not found, creating defaults...")
|
||||||
|
handler = AppConfig.__new__(AppConfig)
|
||||||
|
handler.sync_defaults()
|
||||||
|
config = AppConfig.CONFIG_DEFAULTS
|
||||||
|
|
||||||
if config["application"]["enable_snapshot"]:
|
if config["application"]["enable_snapshot"]:
|
||||||
# take snapshot if enabled
|
# take snapshot if enabled
|
||||||
ElasticSnapshot().take_snapshot_now(wait=True)
|
ElasticSnapshot().take_snapshot_now(wait=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user