Heroku Scheduler overlapping jobs

29 Views Asked by At

I have a 6 jobs scheduled to be executed according with the next squema:

  • :00
  • :10
  • :20
  • :30
  • :40
  • :50

A job which started at :00 might take 15 minutes, so I don't want the task to be executed at :10 is executed but is in fact executed as the other are too, independently if there are task being executed, this create a new scheduler always.

I have the basic plan

I though to create in my python code a line to determinate if there is at least a scheduler running, don't do anything, but I don't know how to reach that into my python code.

I also though to avoid the creation of more than 1 scheduler through the Procfile like adding this heroku ps:scale scheduler=1 but I didn't work.

Edit

Finally I had to interact with a database in order to register there when a job is running. So basically, I created a table with 3 columns, started_at, finished_at, and status. Thanks to @ceejayoz by his help

0

There are 0 best solutions below