ERROR: pgbouncer cannot connect to server
Extracted source (around line #58):
56
57
58
59
60
61
|
### Convenience alias for PG::Connection.new.
def self::connect( *args )
return PG::Connection.new( *args )
end
|
Extracted source (around line #58):
56
57
58
59
60
61
|
### Convenience alias for PG::Connection.new.
def self::connect( *args )
return PG::Connection.new( *args )
end
|
Extracted source (around line #58):
56
57
58
59
60
61
|
### Convenience alias for PG::Connection.new.
def self::connect( *args )
return PG::Connection.new( *args )
end
|
Extracted source (around line #692):
690
691
692
693
694
695
|
# connected server's characteristics.
def connect
@connection = PG.connect(@connection_parameters)
configure_connection
rescue ::PG::Error => error
if error.message.include?("does not exist")
|
Extracted source (around line #223):
221
222
223
224
225
226
|
@max_identifier_length = nil
connect
add_pg_encoders
@statements = StatementPool.new @connection,
self.class.type_cast_config_to_integer(config[:statement_limit])
|
Extracted source (around line #48):
46
47
48
49
50
51
|
# The postgres drivers don't allow the creation of an unconnected PG::Connection object,
# so just pass a nil connection object for the time being.
ConnectionAdapters::PostgreSQLAdapter.new(nil, logger, conn_params, config)
end
end
|
Extracted source (around line #48):
46
47
48
49
50
51
|
# The postgres drivers don't allow the creation of an unconnected PG::Connection object,
# so just pass a nil connection object for the time being.
ConnectionAdapters::PostgreSQLAdapter.new(nil, logger, conn_params, config)
end
end
|
Extracted source (around line #830):
828
829
830
831
832
833
|
def new_connection
Base.send(spec.adapter_method, spec.config).tap do |conn|
conn.schema_cache = schema_cache.dup if schema_cache
end
end
|
Extracted source (around line #874):
872
873
874
875
876
877
|
def checkout_new_connection
raise ConnectionNotEstablished unless @automatic_reconnect
new_connection
end
def checkout_and_verify(c)
|
Extracted source (around line #853):
851
852
853
854
855
856
|
# if successfully incremented @now_connecting establish new connection
# outside of synchronized section
conn = checkout_new_connection
ensure
synchronize do
if conn
|
Extracted source (around line #814):
812
813
814
815
816
817
|
# and +try_to_checkout_new_connection+ we can piggyback on +synchronize+ sections
# of the said methods and avoid an additional +synchronize+ overhead.
if conn = @available.poll || try_to_checkout_new_connection
conn
else
reap
|
Extracted source (around line #538):
536
537
538
539
540
541
|
# - ActiveRecord::ConnectionTimeoutError no connection can be obtained from the pool.
def checkout(checkout_timeout = @checkout_timeout)
checkout_and_verify(acquire_connection(checkout_timeout))
end
# Check-in a database connection back into the pool, indicating that you
|
Extracted source (around line #382):
380
381
382
383
384
385
|
# held in a cache keyed by a thread.
def connection
@thread_cached_conns[connection_cache_key(current_thread)] ||= checkout
end
# Returns true if there is an open connection being used for the current thread.
|
Extracted source (around line #1033):
1031
1032
1033
1034
1035
1036
|
pool = retrieve_connection_pool(spec_name)
raise ConnectionNotEstablished, "No connection pool with '#{spec_name}' found." unless pool
pool.connection
end
# Returns true if a connection that's accessible to this class has
|
Extracted source (around line #118):
116
117
118
119
120
121
|
def retrieve_connection
connection_handler.retrieve_connection(connection_specification_name)
end
# Returns +true+ if Active Record is connected.
|
Extracted source (around line #90):
88
89
90
91
92
93
|
# to any of the specific Active Records.
def connection
retrieve_connection
end
attr_writer :connection_specification_name
|
Extracted source (around line #466):
464
465
466
467
468
469
|
def load_schema!
@columns_hash = connection.schema_cache.columns_hash(table_name).except(*ignored_columns)
@columns_hash.each do |name, column|
define_attribute(
name,
|
Extracted source (around line #234):
232
233
234
235
236
237
|
def load_schema! # :nodoc:
super
attributes_to_define_after_schema_loads.each do |name, (type, options)|
if type.is_a?(Symbol)
type = ActiveRecord::Type.lookup(type, **options.except(:default))
|
Extracted source (around line #51):
49
50
51
52
53
54
|
def load_schema!
super
attribute_types.each do |name, type|
decorated_type = attribute_type_decorations.apply(name, type)
define_attribute(name, decorated_type)
|
Extracted source (around line #459):
457
458
459
460
461
462
|
return if defined?(@columns_hash) && @columns_hash
load_schema!
@schema_loaded = true
end
|
Extracted source (around line #235):
233
234
235
236
237
238
|
Thread.handle_interrupt(EXCEPTION_NEVER){ mon_enter }
begin
yield
ensure
Thread.handle_interrupt(EXCEPTION_NEVER){ mon_exit }
end
|
Extracted source (around line #456):
454
455
456
457
458
459
|
def load_schema
return if schema_loaded?
@load_schema_monitor.synchronize do
return if defined?(@columns_hash) && @columns_hash
load_schema!
|
Extracted source (around line #346):
344
345
346
347
348
349
|
def attribute_types # :nodoc:
load_schema
@attribute_types ||= Hash.new(Type.default_value)
end
|
Extracted source (around line #370):
368
369
370
371
372
373
|
attribute_types.fetch(attr_name, &block)
else
attribute_types[attr_name]
end
end
|
Extracted source (around line #33):
31
32
33
34
35
36
|
def type(column_name)
if klass
klass.type_for_attribute(column_name)
else
Type.default_value
end
|
Extracted source (around line #51):
49
50
51
52
53
54
|
def build(attribute, value)
if table.type(attribute.name).force_equality?(value)
bind = build_bind_attribute(attribute.name, value)
attribute.eq(bind)
else
|
Extracted source (around line #112):
110
111
112
113
114
115
|
end
else
build(table.arel_attribute(key), value)
end
end
end
|
Extracted source (around line #71):
69
70
71
72
73
74
|
return ["1=0"] if attributes.empty?
attributes.flat_map do |key, value|
if value.is_a?(Hash) && !table.has_column?(key)
associated_predicate_builder(key).expand_from_hash(value)
elsif table.associated_with?(key)
|
Extracted source (around line #71):
69
70
71
72
73
74
|
return ["1=0"] if attributes.empty?
attributes.flat_map do |key, value|
if value.is_a?(Hash) && !table.has_column?(key)
associated_predicate_builder(key).expand_from_hash(value)
elsif table.associated_with?(key)
|
Extracted source (around line #71):
69
70
71
72
73
74
|
return ["1=0"] if attributes.empty?
attributes.flat_map do |key, value|
if value.is_a?(Hash) && !table.has_column?(key)
associated_predicate_builder(key).expand_from_hash(value)
elsif table.associated_with?(key)
|
Extracted source (around line #21):
19
20
21
22
23
24
|
def build_from_hash(attributes)
attributes = convert_dot_notation_to_hash(attributes)
expand_from_hash(attributes)
end
def self.references(attributes)
|
Extracted source (around line #19):
17
18
19
20
21
22
|
attributes.stringify_keys!
parts = predicate_builder.build_from_hash(attributes)
when Arel::Nodes::Node
parts = [opts]
else
|
Extracted source (around line #588):
586
587
588
589
590
591
|
opts = sanitize_forbidden_attributes(opts)
references!(PredicateBuilder.references(opts)) if Hash === opts
self.where_clause += where_clause_factory.build(opts, rest)
self
end
|
Extracted source (around line #581):
579
580
581
582
583
584
|
self
else
spawn.where!(opts, *rest)
end
end
|
Extracted source (around line #12):
10
11
12
13
14
15
|
delegate :destroy_all, :delete_all, :update_all, to: :all
delegate :find_each, :find_in_batches, :in_batches, to: :all
delegate :select, :group, :order, :except, :reorder, :limit, :offset, :joins, :left_joins, :left_outer_joins, :or,
:where, :rewhere, :preload, :eager_load, :includes, :from, :lock, :readonly, :extending,
:having, :create_with, :distinct, :references, :none, :unscope, :merge, to: :all
delegate :count, :average, :minimum, :maximum, :sum, :calculate, to: :all
|
Extracted source (around line #202):
200
201
202
203
204
205
|
def pricing_plans
Rails.cache.fetch "pricing_plans", expires_in: 5.minutes do
Gila::CommissionCode.where(code: Plan::START_AND_STANDARD).map do |r|
r.as_json.slice("flat", "percent", "max", "broker_fee", "currency", "country", "code")
end
end
|
Extracted source (around line #114):
112
113
114
115
116
117
|
if not_found == entry
result = instrument_with_log(:generate, namespaced_name, options) do |payload|
yield
end
write(name, result, options)
result
|
Extracted source (around line #383):
381
382
383
384
385
386
|
payload = { :key => key }
payload.merge!(options) if options.is_a?(Hash)
instrument(operation, payload) { |p| yield(p) }
end
def instrument_error(error)
|
Extracted source (around line #392):
390
391
392
393
394
395
|
def instrument(operation, payload)
ActiveSupport::Notifications.instrument("cache_#{operation}.active_support", payload) do
yield(payload) if block_given?
end
end
|
Extracted source (around line #168):
166
167
168
169
170
171
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #23):
21
22
23
24
25
26
|
listeners_state = start name, payload
begin
yield payload
rescue Exception => e
payload[:exception] = [e.class.name, e.message]
payload[:exception_object] = e
|
Extracted source (around line #168):
166
167
168
169
170
171
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #391):
389
390
391
392
393
394
|
def instrument(operation, payload)
ActiveSupport::Notifications.instrument("cache_#{operation}.active_support", payload) do
yield(payload) if block_given?
end
end
|
Extracted source (around line #383):
381
382
383
384
385
386
|
payload = { :key => key }
payload.merge!(options) if options.is_a?(Hash)
instrument(operation, payload) { |p| yield(p) }
end
def instrument_error(error)
|
Extracted source (around line #113):
111
112
113
114
115
116
|
if not_found == entry
result = instrument_with_log(:generate, namespaced_name, options) do |payload|
yield
end
write(name, result, options)
|
Extracted source (around line #201):
199
200
201
202
203
204
|
def pricing_plans
Rails.cache.fetch "pricing_plans", expires_in: 5.minutes do
Gila::CommissionCode.where(code: Plan::START_AND_STANDARD).map do |r|
r.as_json.slice("flat", "percent", "max", "broker_fee", "currency", "country", "code")
end
|
Extracted source (around line #44):
42
43
44
45
46
47
|
@currency_data[currency]['image_path'] = ActionController::Base.helpers.asset_path("static/pricing/flags/#{currency}.svg")
end
@pricing_plans = pricing_plans
@disabled_pp_currencies = DISABLED_PAYMENT_PLAN_CURRENCIES
end
|
Extracted source (around line #6):
4
5
6
7
8
9
|
module BasicImplicitRender # :nodoc:
def send_action(method, *args)
super.tap { default_render unless performed? }
end
def default_render(*args)
|
Extracted source (around line #194):
192
193
194
195
196
197
|
# which is *not* necessarily the same as the action name.
def process_action(method_name, *args)
send_action(method_name, *args)
end
# Actually call the method associated with the action. Override
|
Extracted source (around line #30):
28
29
30
31
32
33
|
def process_action(*) #:nodoc:
self.formats = request.formats.map(&:ref).compact
super
end
# Check for double render errors and set the content_type after rendering.
|
Extracted source (around line #42):
40
41
42
43
44
45
|
def process_action(*args)
run_callbacks(:process_action) do
super
end
end
|
Extracted source (around line #109):
107
108
109
110
111
112
|
current.invoke_before(env)
if current.final?
env.value = !env.halted && (!block_given? || yield)
elsif current.skip?(env)
(skipped ||= []) << current
next_sequence = next_sequence.nested
|
Extracted source (around line #10):
8
9
10
11
12
13
|
Current.su_user_id = session.try(:[],:su_user_id)
Current.request = request
action.call
ensure
Current.reset
end
|
Extracted source (around line #118):
116
117
118
119
120
121
|
begin
target, block, method, *arguments = current.expand_call_template(env, invoke_sequence)
target.send(method, *arguments, &block)
ensure
next_sequence = current
end
|
Extracted source (around line #118):
116
117
118
119
120
121
|
begin
target, block, method, *arguments = current.expand_call_template(env, invoke_sequence)
target.send(method, *arguments, &block)
ensure
next_sequence = current
end
|
Extracted source (around line #136):
134
135
136
137
138
139
|
env.value
else
invoke_sequence.call
end
end
end
|
Extracted source (around line #41):
39
40
41
42
43
44
|
# <tt>process_action</tt> callbacks around the normal behavior.
def process_action(*args)
run_callbacks(:process_action) do
super
end
end
|
Extracted source (around line #22):
20
21
22
23
24
25
|
private
def process_action(*args)
super
rescue Exception => exception
request.env["action_dispatch.show_detailed_exceptions"] ||= show_detailed_exceptions?
rescue_with_handler(exception) || raise
|
Extracted source (around line #30):
28
29
30
31
32
33
|
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
result = super(arg)
payload[:status] = response.status
append_info_to_payload(payload)
result
|
Extracted source (around line #168):
166
167
168
169
170
171
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #23):
21
22
23
24
25
26
|
listeners_state = start name, payload
begin
yield payload
rescue Exception => e
payload[:exception] = [e.class.name, e.message]
payload[:exception_object] = e
|
Extracted source (around line #168):
166
167
168
169
170
171
|
def instrument(name, payload = {})
if notifier.listening?(name)
instrumenter.instrument(name, payload) { yield payload if block_given? }
else
yield payload if block_given?
end
|
Extracted source (around line #29):
27
28
29
30
31
32
|
ActiveSupport::Notifications.instrument("start_processing.action_controller", raw_payload.dup)
ActiveSupport::Notifications.instrument("process_action.action_controller", raw_payload) do |payload|
result = super(arg)
payload[:status] = response.status
append_info_to_payload(payload)
|
Extracted source (around line #256):
254
255
256
257
258
259
|
request.filtered_parameters.merge! wrapped_filtered_hash
end
super
end
private
|
Extracted source (around line #209):
207
208
209
210
211
212
|
# and it won't be cleaned up by the method below.
Searchkick::LogSubscriber.reset_runtime
super
end
def cleanup_view_runtime
|
Extracted source (around line #24):
22
23
24
25
26
27
|
# and it won't be cleaned up by the method below.
ActiveRecord::LogSubscriber.reset_runtime
super
end
def cleanup_view_runtime
|
Extracted source (around line #19):
17
18
19
20
21
22
|
def process_action(action, *args)
Collector.reset_runtime
super
end
# Override to collect the measurements.
|
Extracted source (around line #134):
132
133
134
135
136
137
|
@_response_body = nil
process_action(action_name, *args)
end
# Delegates to the class' ::controller_path
|
Extracted source (around line #32):
30
31
32
33
34
35
|
def process(*) #:nodoc:
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
super
ensure
I18n.config = old_config
end
|
Extracted source (around line #78):
76
77
78
79
80
81
|
klass.send :alias_method, without_profiling, method
klass.send :define_method, with_profiling do |*args, &orig|
return self.send without_profiling, *args, &orig unless Rack::MiniProfiler.current
name = default_name
if blk
|
Extracted source (around line #191):
189
190
191
192
193
194
|
set_request!(request)
set_response!(response)
process(name)
request.commit_flash
to_a
end
|
Extracted source (around line #252):
250
251
252
253
254
255
|
middleware_stack.build(name) { |env| new.dispatch(name, req, res) }.call req.env
else
new.dispatch(name, req, res)
end
end
end
|
Extracted source (around line #52):
50
51
52
53
54
55
|
def dispatch(controller, action, req, res)
controller.dispatch(action, req, res)
end
end
|
Extracted source (around line #34):
32
33
34
35
36
37
|
controller = controller req
res = controller.make_response! req
dispatch(controller, params[:action], req, res)
rescue ActionController::RoutingError
if @raise_on_name_error
raise
|
Extracted source (around line #52):
50
51
52
53
54
55
|
req.path_parameters = set_params.merge parameters
status, headers, body = route.app.serve(req)
if "pass" == headers["X-Cascade"]
req.script_name = script_name
|
Extracted source (around line #35):
33
34
35
36
37
38
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #35):
33
34
35
36
37
38
|
def serve(req)
find_routes(req).each do |match, parameters, route|
set_params = req.path_parameters
path_info = req.path_info
script_name = req.script_name
|
Extracted source (around line #840):
838
839
840
841
842
843
|
req = make_request(env)
req.path_info = Journey::Router::Utils.normalize_path(req.path_info)
@router.serve(req)
end
def recognize_path(path, environment = {})
|
Extracted source (around line #14):
12
13
14
15
16
17
|
Skylight::Core::Fanout.endpoint = self.class.name
Skylight::Core::Fanout.instrument(title: self.class.name, category: "rack.app") do
call_without_sk(env)
end
end
end
|
Extracted source (around line #25):
23
24
25
26
27
28
|
meta = {}
begin
yield spans
ensure
done(spans, meta)
end
|
Extracted source (around line #13):
11
12
13
14
15
16
|
def call(env)
Skylight::Core::Fanout.endpoint = self.class.name
Skylight::Core::Fanout.instrument(title: self.class.name, category: "rack.app") do
call_without_sk(env)
end
end
|
Extracted source (around line #190):
188
189
190
191
192
193
|
return callback_call if on_callback_path?
return other_phase if respond_to?(:other_phase)
@app.call(env)
end
# Responds to an OPTIONS request.
|
Extracted source (around line #168):
166
167
168
169
170
171
|
# @param [Hash] The Rack environment.
def call(env)
dup.call!(env)
end
# The logic for dispatching any additional actions that need
|
Extracted source (around line #190):
188
189
190
191
192
193
|
return callback_call if on_callback_path?
return other_phase if respond_to?(:other_phase)
@app.call(env)
end
# Responds to an OPTIONS request.
|
Extracted source (around line #168):
166
167
168
169
170
171
|
# @param [Hash] The Rack environment.
def call(env)
dup.call!(env)
end
# The logic for dispatching any additional actions that need
|
Extracted source (around line #190):
188
189
190
191
192
193
|
return callback_call if on_callback_path?
return other_phase if respond_to?(:other_phase)
@app.call(env)
end
# Responds to an OPTIONS request.
|
Extracted source (around line #168):
166
167
168
169
170
171
|
# @param [Hash] The Rack environment.
def call(env)
dup.call!(env)
end
# The logic for dispatching any additional actions that need
|
Extracted source (around line #175):
173
174
175
176
177
178
|
if safelisted?(request)
@app.call(env)
elsif blocklisted?(request)
self.class.blocklisted_response.call(env)
elsif throttled?(request)
|
Extracted source (around line #21):
19
20
21
22
23
|
env['FASTLY_GEO_LONGITUDE'] = env['HTTP_X_GEO_LONGITUDE']
@app.call env
end
end
|
Extracted source (around line #10):
8
9
10
11
12
13
|
def call(env)
dup._call env
end
def _call(env)
|
Extracted source (around line #11):
9
10
11
12
13
14
|
def call(env)
begin
@app.call(env)
ensure
BatchLoader::Executor.clear_current
end
|
Extracted source (around line #36):
34
35
36
37
38
39
|
result = catch(:warden) do
env['warden'].on_request
@app.call(env)
end
result ||= {}
|
Extracted source (around line #34):
32
33
34
35
36
37
|
env['warden'] = Proxy.new(env, self)
result = catch(:warden) do
env['warden'].on_request
@app.call(env)
end
|
Extracted source (around line #34):
32
33
34
35
36
37
|
env['warden'] = Proxy.new(env, self)
result = catch(:warden) do
env['warden'].on_request
@app.call(env)
end
|
Extracted source (around line #29):
27
28
29
30
31
32
|
# call framework
@app.call(env)
end
end
end
|
Extracted source (around line #19):
17
18
19
20
21
22
|
def call(env)
dup._call env
end
def _call(env)
|
Extracted source (around line #15):
13
14
15
16
17
18
|
def call(env)
env[RACK_TEMPFILES] ||= []
status, headers, body = @app.call(env)
body_proxy = BodyProxy.new(body) do
env[RACK_TEMPFILES].each(&:close!) unless env[RACK_TEMPFILES].nil?
end
|
Extracted source (around line #27):
25
26
27
28
29
30
|
def call(env)
status, headers, body = @app.call(env)
headers = Utils::HeaderHash[headers]
|
Extracted source (around line #27):
25
26
27
28
29
30
|
case env[REQUEST_METHOD]
when "GET", "HEAD"
status, headers, body = @app.call(env)
headers = Utils::HeaderHash[headers]
if status == 200 && fresh?(env, headers)
status = 304
|
Extracted source (around line #12):
10
11
12
13
14
15
|
def call(env)
status, headers, body = @app.call(env)
if env[REQUEST_METHOD] == HEAD
[
|
Extracted source (around line #18):
16
17
18
19
20
21
|
def call(env)
request = ActionDispatch::Request.new env
_, headers, _ = response = @app.call(env)
return response unless html_response?(headers)
return response if policy_present?(headers)
|
Extracted source (around line #266):
264
265
266
267
268
269
|
req = make_request env
prepare_session(req)
status, headers, body = app.call(req.env)
res = Rack::Response::Raw.new status, headers
commit_session(req, res)
[status, headers, body]
|
Extracted source (around line #260):
258
259
260
261
262
263
|
def call(env)
context(env)
end
def context(env, app = @app)
|
Extracted source (around line #670):
668
669
670
671
672
673
|
request = ActionDispatch::Request.new env
status, headers, body = @app.call(env)
if request.have_cookie_jar?
cookie_jar = request.cookie_jar
|
Extracted source (around line #52):
50
51
52
53
54
55
|
modify_location_and_redirect
elsif ssl_request?
status, headers, body = @app.call(env)
flag_cookies_as_secure!(headers) if @options[:force_secure_cookies]
set_hsts_headers!(headers) if @options[:hsts] && !@options[:strict]
[status, headers, body]
|
Extracted source (around line #28):
26
27
28
29
30
31
|
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
end
end
|
Extracted source (around line #98):
96
97
98
99
100
101
|
if callbacks.empty?
yield if block_given?
else
env = Filters::Environment.new(self, false, nil)
next_sequence = callbacks.compile
|
Extracted source (around line #26):
24
25
26
27
28
29
|
def call(env)
error = nil
result = run_callbacks :call do
begin
@app.call(env)
rescue => error
|
Extracted source (around line #12):
10
11
12
13
14
15
|
begin
@app.call(env)
rescue => e
env["sentry.rescued_exception"] = e if report_rescued_exceptions?
raise e
|
Extracted source (around line #61):
59
60
61
62
63
64
|
def call(env)
request = ActionDispatch::Request.new env
_, headers, body = response = @app.call(env)
if headers["X-Cascade"] == "pass"
body.close if body.respond_to?(:close)
|
Extracted source (around line #28):
26
27
28
29
30
31
|
begin
response = @app.call(env)
rescue Sentry::Error
finish_transaction(transaction, 500)
raise # Don't capture Sentry errors
|
Extracted source (around line #220):
218
219
220
221
222
223
|
start_session
yield
ensure
end_session
end
|
Extracted source (around line #375):
373
374
375
376
377
378
|
def with_session_tracking(&block)
return yield unless initialized?
get_current_hub.with_session_tracking(&block)
end
# Takes an exception and reports it to Sentry via the currently active hub.
|
Extracted source (around line #19):
17
18
19
20
21
22
|
Sentry.with_scope do |scope|
Sentry.with_session_tracking do
scope.clear_breadcrumbs
scope.set_transaction_name(env["PATH_INFO"], source: :url) if env["PATH_INFO"]
scope.set_rack_env(env)
|
Extracted source (around line #59):
57
58
59
60
61
62
|
def with_scope(&block)
push_scope
yield(current_scope)
ensure
pop_scope
end
|
Extracted source (around line #355):
353
354
355
356
357
358
|
def with_scope(&block)
return yield unless initialized?
get_current_hub.with_scope(&block)
end
# Wrap a given block with session tracking.
|
Extracted source (around line #18):
16
17
18
19
20
21
|
Sentry.clone_hub_to_current_thread
Sentry.with_scope do |scope|
Sentry.with_session_tracking do
scope.clear_breadcrumbs
scope.set_transaction_name(env["PATH_INFO"], source: :url) if env["PATH_INFO"]
|
Extracted source (around line #33):
31
32
33
34
35
36
|
def call(env)
request = ActionDispatch::Request.new env
@app.call(env)
rescue Exception => exception
if request.show_exceptions?
render_exception(request, exception)
|
Extracted source (around line #15):
13
14
15
16
17
18
|
def call_app(*args)
env = args.last
@app.call(env)
ensure
ActiveSupport::LogSubscriber.flush_all!
end
|
Extracted source (around line #28):
26
27
28
29
30
31
|
logger.tagged(compute_tags(request)) { call_app(request, env) }
else
call_app(request, env)
end
end
|
Extracted source (around line #81):
79
80
81
82
83
84
|
req = ActionDispatch::Request.new env
req.remote_ip = GetIp.new(req, check_ip, proxies)
@app.call(req.env)
end
# The GetIp class exists as a way to defer processing of the request data
|
Extracted source (around line #19):
17
18
19
20
21
22
|
RequestStore.begin!
response = @app.call(env)
returned = response << Rack::BodyProxy.new(response.pop) do
RequestStore.end!
|
Extracted source (around line #27):
25
26
27
28
29
30
|
req = ActionDispatch::Request.new env
req.request_id = make_request_id(req.x_request_id)
@app.call(env).tap { |_status, headers, _body| headers[X_REQUEST_ID] = req.request_id }
end
private
|
Extracted source (around line #12):
10
11
12
13
14
15
|
def call(env)
@skylight_request_id = env["skylight.request_id"]
call_without_sk(env)
end
private
|
Extracted source (around line #24):
22
23
24
25
26
27
|
end
@app.call(env)
end
def method_override(env)
|
Extracted source (around line #22):
20
21
22
23
24
25
|
def call(env)
start_time = Utils.clock_time
status, headers, body = @app.call(env)
headers = Utils::HeaderHash[headers]
request_time = Utils.clock_time - start_time
|
Extracted source (around line #29):
27
28
29
30
31
32
|
def call(env)
LocalCacheRegistry.set_cache_for(local_cache_key, LocalStore.new)
response = @app.call(env)
response[2] = ::Rack::BodyProxy.new(response[2]) do
LocalCacheRegistry.set_cache_for(local_cache_key, nil)
end
|
Extracted source (around line #14):
12
13
14
15
16
17
|
state = @executor.run!(reset: true)
begin
response = @app.call(env)
returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
ensure
state.complete! unless returned
|
Extracted source (around line #127):
125
126
127
128
129
130
|
end
@app.call(req.env)
end
end
end
|
Extracted source (around line #110):
108
109
110
111
112
113
|
def call(env)
status, headers, body = @app.call(env)
if body.respond_to?(:to_path)
case type = variation(env)
when 'X-Accel-Redirect'
|
Extracted source (around line #174):
172
173
174
175
176
177
|
!client_settings.has_valid_cookie?
)
return client_settings.handle_cookie(@app.call(env))
end
# handle all /mini-profiler requests here
|
Extracted source (around line #81):
79
80
81
82
83
84
|
vary_resource = resource_for_path(env[PATH_INFO_HEADER_KEY])
status, headers, body = @app.call env
if add_headers
headers = add_headers.merge(headers)
|
Extracted source (around line #524):
522
523
524
525
526
527
|
def call(env)
req = build_request env
app.call req.env
end
# Defines additional Rack env configuration that is added on each call.
|
Extracted source (around line #190):
188
189
190
191
192
193
|
def method_missing(name, *args, &block)
if instance.respond_to?(name)
instance.public_send(name, *args, &block)
else
super
end
|
Extracted source (around line #190):
188
189
190
191
192
193
|
def method_missing(name, *args, &block)
if instance.respond_to?(name)
instance.public_send(name, *args, &block)
else
super
end
|
Extracted source (around line #228):
226
227
228
229
230
231
|
def call(env)
env[Const::PUMA_CONFIG] = @config
@app.call(env)
end
end
|
Extracted source (around line #713):
711
712
713
714
715
716
|
begin
begin
status, headers, res_body = @app.call(env)
return :async if req.hijacked
|
Extracted source (around line #472):
470
471
472
473
474
475
|
while true
case handle_request(client, buffer)
when false
return
when :async
|
Extracted source (around line #328):
326
327
328
329
330
331
|
else
if process_now
process_client client, buffer
else
client.set_timeout @first_data_timeout
@reactor.add client
|
Extracted source (around line #134):
132
133
134
135
136
137
|
begin
block.call(work, *extra)
rescue Exception => e
STDERR.puts "Error reached top of thread-pool: #{e.message} (#{e.class})"
end
|
Rails.root: /app
Request
Parameters:
None
_csrf_token: "oaGdf27fa2vLrdOLq5mKd8WmmAQNHBLQMNRQEBz9uOA="
user_return_to: "https://staging.universe.com/create"
GATEWAY_INTERFACE: "CGI/1.2"
HTTP_ACCEPT: "*/*"
HTTP_CLIENT_IP: "44.192.247.185"
HTTP_VERSION: "HTTP/1.1"
HTTP_X_FORWARDED_FOR: "44.192.247.185"
HTTP_X_FORWARDED_HOST: "staging.universe.com"
HTTP_X_REQUEST_ID: "87bd8e25b19b11ef305d5b5c7a8e8ea7"
ORIGINAL_SCRIPT_NAME: ""
REMOTE_ADDR: "10.34.48.42"
SERVER_NAME: "staging.universe.com"
SERVER_PROTOCOL: "HTTP/1.1"
Response
Headers:
None