lib/instana/tracing/processor.rb in instana-1.7.0 vs lib/instana/tracing/processor.rb in instana-1.7.1

- old
+ new

@@ -23,9 +23,14 @@ # Adds a trace to the queue to be processed and # sent to the host agent # # @param [Trace] the trace to be added to the queue def add(trace) + # Do a quick checkup on our background thread. + if ::Instana.agent.collect_thread.nil? || !::Instana.agent.collect_thread.alive? + ::Instana.agent.spawn_background_thread + end + # ::Instana.logger.debug("Queuing completed trace id: #{trace.id}") @queue.push(trace) end # Adds a trace to the staging queue.