谁能举例说明Google App Engine的python运行时中的预热入站服务是如何工作的?
我读过这个:http://code.google.com/appengine/docs/python/config/appconfig.html#Inbound_Services,但在发送GET请求之后,它并没有给我提供太多的示例(我似乎永远也拿不起它)
我的app.yaml看起来像这样:
application: whatevs
version: 1
runtime: python
api_version: 1
builtins:
- datastore_admin: on
inbound_services:
- warmup
handlers:
- url: /static
static_dir: static
- url: /_ah/warmup
script: main.py
login: admin
- url: /.*
script: main.py我的main.py看起来像这样:
def main():
application = webapp.WSGIApplication(
[("/", views.LandingPage),
("/_ah/warmup", views.WarmupHandler)
],
debug=True)
run_wsgi_app(application)WarmupHandler看起来像这样:
class WarmupHandler(webapp.RequestHandler):
"""
Called on app init
"""
def get(self):
current_user = users.get_current_user()
return然而,WarmupHandler似乎从未被调用过(我有断点和许多调试代码)。我做错了什么?
发布于 2011-11-23 21:03:25
应用程序引擎仅在应用程序上存在持续流量时才发送预热请求。如果实例大部分处于空闲状态,则不会总是调用它。
https://stackoverflow.com/questions/8235716
复制相似问题