-2

I have a web instance (python API) on Heroku and I want to start a background process from this API.

The process is base on an infinity loop, and it will be stop from the API as well.

I try to run a subprocess from python and it's work well on my localhost, but not on Heroku.

Heroku seems to stop the process after 30 minutes of inactivity (input or output) and anyway it seems like Heroku restarts the Dynos every 24h.

How can I do to run a process on Heroku server (free version) and be sure that it doesn't stop?

Malekai
  • 4,765
  • 5
  • 25
  • 60

1 Answers1

0

Please see this answer:

Possible to bypass Heroku's free plan's "Sleeps after 30 mins of inactivity" with console.logs?

In short, it's impractical to do this for at least two reasons:

  1. You'll need a way to keep your process alive
  2. You'll run through your free dyno hours
davejagoda
  • 2,420
  • 1
  • 20
  • 27