17 lines
344 B
Ruby
17 lines
344 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Middleware::ProcessingRequest
|
|
PROCESSING_REQUEST_THREAD_KEY = "discourse.processing_request"
|
|
|
|
def initialize(app)
|
|
@app = app
|
|
end
|
|
|
|
def call(env)
|
|
Thread.current[PROCESSING_REQUEST_THREAD_KEY] = true
|
|
@app.call(env)
|
|
ensure
|
|
Thread.current[PROCESSING_REQUEST_THREAD_KEY] = nil
|
|
end
|
|
end
|