javascript - Flask + Heroku:H12 请求超时错误
问题描述
我有一个 Heroku 应用程序来运行 Scrapy Spider。启动后,我收到错误 H12。如何解决?
查询:
$.post('/wellness', {'specialty': specialty, 'state': state, 'city': city}, (res) => {
$(location).attr('href', 'http://127.0.0.1:5000/wellness')
});
烧瓶:
if request.method == 'POST':
specialty = request.form.getlist('specialty[]')
state = request.form.getlist('state[]')
city = request.form.getlist('city[]')
settings = ''
with open(file_json, 'r') as f:
for line in f.read():
settings += line
settings = json.loads(settings)
settings['specialty'] = specialty
settings['state'] = state
settings['city'] = city
with open(file_json, 'w') as f:
f.write(json.dumps(settings, indent=4))
process = subprocess.Popen('python spiders/' + file_py, shell=True)
process.wait()
return render_template(file_html)
解决方案
推荐阅读
- angular - 使用 ng serve 使用节点 12 编译 Angular (7) 后,Chrome 花费的时间太长
- python - 扩展 matplotlib 绘图输出
- azure-devops - 在 Azure DevOps 中脚本失败后继续构建
- java - 如何初始化矩阵对象
- batch-file - 具有从 cmd 调用的输入重定向的批处理脚本自动添加数字参数
- flutter - 在屏幕之间传递数据
- asp.net-mvc - ASP.NET MVC 5 Identity - 更改密码后如何让用户保持登录状态?
- node.js - 我应该如何在 NodeJs 中使用多种不同的两种语言?
- html - React 按钮单击事件未触发 - 一键有效,一键无效
- xml - 将 XML 导入 Excel 时,是否可以在一行中导入节点及其子节点?如果是,怎么做?