首页 > 解决方案 > 如何处理啊/从 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一些日志记录应该在启动时出现,但我什么也没看到。

标签: pythongoogle-app-enginegoogle-cloud-platform

解决方案


原来有一个前端代理拦截了事件!


推荐阅读