Skip to content

Commit

Permalink
do not instantiate empty array every time when sending events
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jun 21, 2024
1 parent e8bd4f1 commit d501969
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/datadog/core/telemetry/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ def perform(*events)
end

def flush_events(events)
return if events.nil?
return if !enabled? || !sent_started_event?

Datadog.logger.debug { "Sending #{events&.count} telemetry events" }
(events || []).each do |event|
events.each do |event|
send_event(event)
end
end
Expand Down

0 comments on commit d501969

Please sign in to comment.