AwesomeHunter
Making sure the application is running
Hi!
I want to start the release using bin/my_app start and then call functions using rpc requests. How do I check if the application is running? Does running the start command more than once start the application multiple times, or only the first time? If multiple times, is the appropriate solution to send an rpc request and see if it succeeded?
Marked As Solved
dimitarvp
Make a small endpoint that basically tries to read something from the DB and if it succeeds the endpoint returns HTTP 200 OK. Use that to make sure that the application is running.
Basically roll your own small liveness / readiness k8s probe of sorts.
Also Liked
LostKobrakai
You could also start the application with a systems level init system like systemd and ask that if the service is running.
SirWerto
Hi!
If you have a process with a certain name, you can info to it or use Application.ensure_started/2 but the latter will start the application if it wasn’t already running.
Hope it helps!







