Prevent one off dyno from terminating during long running process

Viewed 44

I have a rails app deployed on a free web dyno, but I'm also trying to run a long running rake task which polls a 3rd party API every 0-15 seconds for 18hrs every day. In order to test it, I've been running the rake task as a detached process: heroku run:detached rails my_task, and monitoring the logs. I've noticed that it almost always stops early due to what seems like Heroku killing the process:

2020-05-08T15:00:38.709849+00:00 app[run.9067]: rails aborted!
2020-05-08T15:00:38.709929+00:00 app[run.9067]: SignalException: SIGTERM

From what I've read in the docs, I should be able to run a process in a one-off dyno for up to 24h (since they restart every day). Why is my process being killed early?

0 Answers
Related