Class: Gitlab::Testing::ClearProcessMemoryCacheMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/testing/clear_process_memory_cache_middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ClearProcessMemoryCacheMiddleware

Returns a new instance of ClearProcessMemoryCacheMiddleware.


6
7
8
# File 'lib/gitlab/testing/clear_process_memory_cache_middleware.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object


10
11
12
13
14
15
16
# File 'lib/gitlab/testing/clear_process_memory_cache_middleware.rb', line 10

def call(env)
  Gitlab::ProcessMemoryCache.cache_backend.clear

  @app.call(env)
ensure
  Gitlab::ProcessMemoryCache.cache_backend.clear
end