Class: Gitlab::Middleware::ReleaseEnv

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab/middleware/release_env.rb

Overview

Some of middleware would hold env for no good reason even after the request had already been processed, and we could not garbage collect them due to this. Put this middleware as the first middleware so that it would clear the env after the request is done, allowing GC gets a chance to release memory for the last request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app


11
12
13
# File 'lib/gitlab/middleware/release_env.rb', line 11

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object


12
13
14
# File 'lib/gitlab/middleware/release_env.rb', line 12

def call(env)
  app.call(env).tap { env.clear }
end