Method: Mongo::QueryCache::Middleware#call

Defined in:
lib/mongo/query_cache.rb

#call(env) ⇒ Object

Enable query cache and execute the request.

Examples:

Execute the request.

middleware.call(env)

Parameters:

  • env (Object)

    The environment.

Returns:

  • (Object)

    The result of the call.



276
277
278
279
280
281
282
# File 'lib/mongo/query_cache.rb', line 276

def call(env)
  QueryCache.cache do
    @app.call(env)
  end
ensure
  QueryCache.clear
end