def __call__(self, environ: Dict[str, str], start_response: webapp2.Response) -> Any: global_cache = datastore_services.RedisCache( cache_services.CLOUD_NDB_REDIS_CLIENT ) # type: ignore[attr-defined] with datastore_services.get_ndb_context(global_cache=global_cache): return self.wsgi_app(environ, start_response)
def __call__(self, environ: Dict[str, str], start_response: webapp2.Response) -> webapp2.Response: global_cache = datastore_services.RedisCache( cache_services.CLOUD_NDB_REDIS_CLIENT ) # type: ignore[attr-defined] with datastore_services.get_ndb_context(global_cache=global_cache): # Cast is needed since webapp2.WSGIApplication is not # correctly typed. return cast(webapp2.Response, self.wsgi_app(environ, start_response))