I have a warmup request in my Google App Engine project. However, the handler is called multiple times when testing on the local dev server
It is configured properly in the app.yaml file:
- url: /_ah/warmup
script: main.app
login: admin
inbound_services:
- warmup
and is doing it's job...I just can't workout why it is being called multiple times. Is this something to do with the local dev setup or somethign I am doing wrong.
Here is the main.py minus the imports
class WarmUpRequestsHandler(webapp2.RequestHandler):
"""
Warmup requests pre gae instance loading
"""
def get(self):
from google.appengine.api import memcache
from product.lib.lib import ProductCaches
logging.info('warmup request handler')
kwargs = {
'klass': TheLatest(),
'products_qry': 'EMA',
'product_entity': 'ema_latest',
'memcache_key': 'ema-latest',
}
entity = ProductCaches(**kwargs)
entity.get_and_set()
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Warmup successful')
webapp2_config = config.config
app = webapp2.WSGIApplication([("/_ah/warmup", WarmUpRequestsHandler)],debug = os.environ['SERVER_SOFTWARE'].startswith('Dev'), config=webapp2_config)
# Import All Routes
adminroutes.add_routes(app)
authroutes.add_routes(app)
emailroutes.add_routes(app)
hotroutes.add_routes(app)
mediaroutes.add_routes(app)
messageroutes.add_routes(app)
paymentroutes.add_routes(app)
productroutes.add_routes(app)
searchroutes.add_routes(app)
storeroutes.add_routes(app)
routes.add_routes(app)