mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
Merge pull request #325 from TheophileDiot/1.5
Fix db init with autoconf
This commit is contained in:
commit
1008490234
2 changed files with 9 additions and 11 deletions
|
@ -186,7 +186,7 @@ if __name__ == "__main__":
|
|||
bw_integration = f.read().strip()
|
||||
|
||||
db = None
|
||||
if "DATABASE_URI" in config_files or bw_integration == "Linux":
|
||||
if bw_integration == "Linux":
|
||||
db = Database(logger, config_files["DATABASE_URI"])
|
||||
elif bw_integration in ("Docker", "Swarm", "Autoconf"):
|
||||
try:
|
||||
|
|
|
@ -151,21 +151,19 @@ if __name__ == "__main__":
|
|||
logger.error("No database found, exiting ...")
|
||||
stop(1)
|
||||
|
||||
if not db.is_initialized():
|
||||
logger.info(
|
||||
"Database is not initialized, waiting ...",
|
||||
while not db.is_initialized():
|
||||
logger.warning(
|
||||
"Database is not initialized, retrying in 5s ...",
|
||||
)
|
||||
while not db.is_initialized():
|
||||
sleep(3)
|
||||
sleep(3)
|
||||
|
||||
env = db.get_config()
|
||||
if not db.is_first_config_saved() or not env:
|
||||
while not db.is_first_config_saved() or not env:
|
||||
logger.info(
|
||||
"Database doesn't have any config saved yet, waiting ...",
|
||||
"Database doesn't have any config saved yet, retrying in 5s ...",
|
||||
)
|
||||
while not db.is_first_config_saved() or not env:
|
||||
sleep(3)
|
||||
env = db.get_config()
|
||||
sleep(3)
|
||||
env = db.get_config()
|
||||
|
||||
if args.run:
|
||||
# write config to /tmp/variables.env
|
||||
|
|
Loading…
Reference in a new issue