lib/ting_yun/agent/dispatcher.rb in tingyun_rpm-1.2.0 vs lib/ting_yun/agent/dispatcher.rb in tingyun_rpm-1.3.0
- old
+ new
@@ -15,12 +15,16 @@
events.subscribe(:start_transaction, &method(:on_transaction))
end
end
def on_transaction(*_)
- return unless needs_restart?
+ return unless restart_in_children_enabled? && needs_restart?
restart_harvest_thread
+ end
+
+ def restart_in_children_enabled?
+ TingYun::Agent.config[:restart_thread_in_children]
end
def mark_started(pid = Process.pid)
@starting_pid = pid
end