Method: NewRelic::Agent::ErrorTraceAggregator#add_to_error_queue

Defined in:
lib/new_relic/agent/error_trace_aggregator.rb

#add_to_error_queue(noticed_error) ⇒ Object

Synchronizes adding an error to the error queue, and checks if the error queue is too long - if so, we drop the error on the floor after logging a warning.

[View source]

45
46
47
48
49
50
51
52
53
# File 'lib/new_relic/agent/error_trace_aggregator.rb', line 45

def add_to_error_queue(noticed_error)
  return unless enabled?

  @lock.synchronize do
    if !over_queue_limit?(noticed_error.message) && !@errors.include?(noticed_error)
      @errors << noticed_error
    end
  end
end