Class: InfluxDB::Rails::Rack
- Inherits:
-
Object
- Object
- InfluxDB::Rails::Rack
- Defined in:
- lib/influxdb/rails/rack.rb
Overview
rubocop:disable Style/Documentation
Instance Method Summary collapse
- #_call(env) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app) ⇒ Rack
Returns a new instance of Rack.
6 7 8 |
# File 'lib/influxdb/rails/rack.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#_call(env) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/influxdb/rails/rack.rb', line 27 def _call(env) begin response = @app.call(env) rescue StandardError => e InfluxDB::Rails.transmit_unless_ignorable(e, env) raise(e) end response end |
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/influxdb/rails/rack.rb', line 10 def call(env) al_request_guid = env["HTTP_AL_REQUEST_GUID"] || SecureRandom.uuid #al_request_id = SecureRandom.uuid al_request_id = SecureRandom.uuid al_source = "AL_NONE" al_request_client_id = "AL_NONE" Thread.current["al_request_id"] = al_request_id Thread.current["al_request_guid"] = al_request_guid Thread.current["al_source"] = env["HTTP_AL_SOURCE"] || al_source Thread.current["al_request_client_id"] = env["HTTP_AL_REQUEST_CLIENT_ID"] || al_request_client_id env["HTTP_AL_REQUEST_ID"] = al_request_id env["HTTP_AL_REQUEST_GUID"] = al_request_guid dup._call(env) end |