0

I am running a single clock dyno for my app but it crashes immediately after successful build.
Error message -

Build succeeded
heroku[clock.1]: State changed from up to crashed
heroku[clock.1]: State changed from crashed to starting
heroku[clock.1]: Starting process with command `python3 clock.py`
heroku[clock.1]: State changed from starting to up
heroku[clock.1]: Process exited with status 0
heroku[clock.1]: State changed from up to crashed

The error is then repeated all over again.

clock.py-

from apscheduler.schedulers.blocking import BlockingScheduler   
sched = BlockingScheduler(timezone="UTC")
def job_1(): 
    print("Reached Here") 
sched.add_job(job_1,trigger='interval', seconds=150)

Procfile -

clock: python3 clock.py
pundit
  • 127
  • 11

2 Answers2

0

You should correct your Procfile

clock: python clock.py

Heroku uses 3.9.6 as default but you can change this if needed (see Specifying Python version)

Beppe C
  • 11,256
  • 2
  • 19
  • 41
0

Forgot to include sched.start()

pundit
  • 127
  • 11