【问题标题】:Heroku app crashing immediately after deploymentHeroku 应用程序在部署后立即崩溃
【发布时间】:2021-07-07 12:40:43
【问题描述】:

我正在为我的应用运行单时钟测功机,但它在成功构建后立即崩溃。
错误信息 -

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

错误会再次重复。

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

【问题讨论】:

    标签: python heroku crash dyno


    【解决方案1】:

    你应该更正你的Procfile

    clock: python clock.py
    

    Heroku 默认使用 3.9.6,但您可以根据需要更改此设置(请参阅 Specifying Python version

    【讨论】:

    • 不,Heroku网站上的日志一模一样。
    【解决方案2】:

    忘记包含sched.start()

    【讨论】:

      猜你喜欢
      • 2011-08-31
      • 2014-03-12
      • 2021-09-14
      • 2015-10-11
      • 2021-12-07
      • 2020-08-06
      • 2014-10-26
      • 1970-01-01
      相关资源
      最近更新 更多