Currently, the DB check script sometimes fails because the DB isn't yet online, though it would have been a second later.
Some temporary solutions involve waiting a set time, but this needlessly delays the container up process.
Instead, this patch tries in a loop every second to connect, blocking until it comes online, or around 1 minute. This allows the container to come up as quickly as possible (as soon as PG is started), but also to make it more robust.
Currently, the DB check script sometimes fails because the DB isn't yet online, though it would have been a second later.
Some temporary solutions involve waiting a set time, but this needlessly delays the container up process.
Instead, this patch tries in a loop every second to connect, blocking until it comes online, or around 1 minute. This allows the container to come up as quickly as possible (as soon as PG is started), but also to make it more robust.