首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >python -错误R10 (启动超时) ->网络进程无法在启动后60秒内绑定到$PORT

python -错误R10 (启动超时) ->网络进程无法在启动后60秒内绑定到$PORT
EN

Stack Overflow用户
提问于 2016-11-01 16:06:43
回答 1查看 12.7K关注 0票数 19

我在heroku上部署了一个python脚本,它会在每次3 minutes之后向另一个服务器发出请求。

部署进行得很好,但当我看到logs时,我得到了这些errors

代码语言:javascript
复制
2016-11-01T07:42:12.919755+00:00 heroku[web.1]: Starting process with command `python script.py --log-file -`
2016-11-01T07:43:13.097413+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-11-01T07:43:13.097556+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-11-01T07:43:13.196156+00:00 heroku[web.1]: Process exited with status 137
2016-11-01T07:43:13.212942+00:00 heroku[web.1]: State changed from starting to crashed
2016-11-01T07:43:13.213858+00:00 heroku[web.1]: State changed from crashed to starting
2016-11-01T07:43:16.719828+00:00 heroku[web.1]: Starting process with command `python script.py --log-file -`
2016-11-01T07:44:17.215381+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-11-01T07:44:17.215381+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-11-01T07:44:17.364708+00:00 heroku[web.1]: Process exited with status 137
2016-11-01T07:44:17.367610+00:00 heroku[web.1]: State changed from starting to crashed 

Procfile

代码语言:javascript
复制
web: python script.py --log-file -

script.py

代码语言:javascript
复制
import sys
import requests
from apscheduler.schedulers.blocking import BlockingScheduler

sched = BlockingScheduler()

@sched.scheduled_job('interval', minutes=3)
def timed_job():
    try:
        request = requests.get(url='https://royal-tag-services.herokuapp.com/api/sms-service/scheduler/')
    except Exception as e:
        print >>sys.stderr, 'scheduler request failed'

sched.start()

Result of 'tree -L 1' command

代码语言:javascript
复制
├── Procfile
├── requirements.txt
├── script.py
└── supporterenv
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-01 16:20:32

将Procfile中的"web“替换为"worker”。

票数 32
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40356197

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档