3

My app sometimes crashes and I would like to know if there is a Add-on or Dyno that I can deploy which will detect when my app is crashed and restart is automatically.

Kevin Schwertz
  • 123
  • 2
  • 12

1 Answers1

6

There's no add-on which will auto-deploy your crashed app on heroku, but here's a work around.

  • Use a log-management add-on(like papertrail)
  • Watch out for log messages you get when your heroku app crashes.
  • Add custom web-hooks that gets triggered whenever you app gives one of those error-logs that correspond to an app crash.
  • Make these web-hooks to call a custom service that redeploys your application. https://help.papertrailapp.com/kb/how-it-works/web-hooks/

When you encounter an "app crash" situation, it usually means only the "web dyno" is crashed. Your service workers might still be running. Though this approach answers your query, I would recommend not to use it in practice because you would want to manually see you logs, find the reason for app-crash and fix it so you don't have to face it in future.

  • 1
    Is this possible to config Heroku to send a noticed email to owner when app in web dyno crashed ? – Thang Le Apr 23 '18 at 18:00