mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Refactor logger setup in save_config.py for improved clarity and add warning for autoconf instance clearing
This commit is contained in:
parent
c97332e864
commit
3117ab5a8b
1 changed files with 6 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ CUSTOM_CONF_RX = re_compile(
|
|||
)
|
||||
BUNKERWEB_STATIC_INSTANCES_RX = re_compile(r"(http://)?(?P<hostname>(?<![:])\b[^:\s]+\b)(:(?P<port>\d+))?")
|
||||
|
||||
LOGGER = setup_logger("Generator", getenv("CUSTOM_LOG_LEVEL", getenv("LOG_LEVEL", "INFO")))
|
||||
LOGGER = setup_logger("Generator.save_config", getenv("CUSTOM_LOG_LEVEL", getenv("LOG_LEVEL", "INFO")))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
@ -214,6 +214,11 @@ if __name__ == "__main__":
|
|||
if err:
|
||||
LOGGER.warning(f"Couldn't clear manual instances from database : {err}, instances may be incorrect")
|
||||
|
||||
if any(settings.get(setting, "no") == "yes" for setting in ("AUTOCONF_MODE", "SWARM_MODE", "KUBERNETES_MODE")):
|
||||
err = db.update_instances([], method="autoconf", changed=False)
|
||||
if err:
|
||||
LOGGER.warning(f"Couldn't clear autoconf instances from database : {err}, instances may be incorrect")
|
||||
|
||||
changes.append("instances")
|
||||
|
||||
for api in apis:
|
||||
|
|
|
|||
Loading…
Reference in a new issue