Restart heroku dyno on Error
There are schneems/puma_auto_tune or schneems/puma_worker_killer, but they does not work as intended on Heroku. (See https://github.com/schneems/get_process_mem/issues/7.)
So, We need another approach (for now).
Papertrail | Add-ons | Heroku and send alert via webhook
heroku-dyno-restarter (this repo)
Restart web dyno via api (
heroku ps:restart web.x)
Press this button to deploy this app using your heroku account:
You will be asked to fill in a name for the app. Something like "my-company-dyno-restarter".
You will also be asked for your heroku api key. You can get this key here: https://dashboard.heroku.com/account#api-key
After deploy by Heroku button above, fetch your heroku-dyno-restarter app's token.
heroku config:get APP_API_TOKEN -a <your heroku-dyno-restarter app name>
Heroku Dyno Restarter will try to guess your app's name based on the papertrail alert. To override this guess,
you can set
heroku config:set SOURCE_APP_NAME=my-company-app -a <your heroku-dyno-restarter app name>
bundle exec rake