I have a Phoenix app running in Heroku and using Oban for background jobs. I still don’t know why but it can happen that Oban gets stuck and doesn’t pick any job - happily, restarting the app with heroku restart
fixes this problem… until it happens again of course.
So, as a temporary measure until we catch the bug, I’d sleep better if I could monitor the app for stuck jobs and in that case, automatically restart the server.
I can do that using the Heroku API but I wonder if there’s an idiomatic way to restart an Elixir / Phoenix app from inside. Is there one?