python - 如何处理啊/从 python GAE 应用程序开始?
问题描述
我不得不更改我的 GAE 应用程序上的缩放类型来处理长时间运行的请求。
但是现在该应用程序已停止响应,我所看到的只是:
2021-04-09 01:22:59 default[20210409t011947] "GET /_ah/start HTTP/1.1" 200
2021-04-09 01:22:59 default[20210409t011947] "GET /_ah/start HTTP/1.1" 200
2021-04-09 01:23:00 default[20210409t011947] "GET /_ah/start HTTP/1.1" 200
2021-04-09 01:23:00 default[20210409t011947] "GET /_ah/start HTTP/1.1" 200
我知道我必须使用某种类型的 200 响应来响应此启动事件,我正在这样做:
@app.route('/_ah/start')
def startup():
'''app starting'''
logging.info('handle _ah/start')
return {
'status': 'OK',
'msg': 'boot'
}
但是我从来没有看到那个端点实际上被调用了。相反,我只是得到日志,就像我没有回应它一样。
经过一番挖掘后,我发现这条消息谈论的是流量可能没有在实例之间切换并--promote
用于切换但不起作用。
有main.py
一些日志记录应该在启动时出现,但我什么也没看到。
解决方案
原来有一个前端代理拦截了事件!
推荐阅读
- vue.js - Vuex数据可用后如何调用方法?
- java - G Suite账号获取报告java样题
- python - 有什么方法可以更快地训练 numpy 神经网络?
- sql - SQL查找通过所有事件的候选人
- r - 如何从 rmarkdown 代码块中呈现字符串中的乳胶代码?
- cassandra - 为什么 Tombstones 会影响读取性能但不会影响更新?
- c - 释放一个结构数组
- python - 如何保存此模型以及为什么使用“with tf.Graph().as_default()”
- reactjs - 当接收到新对象时,在 useState 中反应更新或添加到对象数组
- html - stackoverflow片段上的html整洁的奇怪行为