I have an application with an external dependency (let’s call it Dep). When my application (App) starts up, the first thing it does it that it also tries to make a connection to Dep.
But when I deploy or do integration tests, I start Dep and App at roughly the same time. Dep takes a while to start (5-20seconds).
My current workaround is to introduce sleep in the startup scripts, but this is quite error prone, so I would like to solve it in a clean way.
My initial tought was to try to make a connection, when that fails, sleep for 2 seconds and try again. If it succeeds, start up. But is that allowed in
Application.start/2? Or can I delay the startup in the
What would be the correct way to solve this? Thanks!