File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
lib/datadog/open_feature/exposures
sig/datadog/open_feature/exposures Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -66,26 +66,24 @@ def dequeue
6666 end
6767
6868 def flush
69- send_events ( *dequeue )
69+ events , dropped = dequeue
70+ send_events ( events || [ ] , dropped || 0 )
7071 end
7172
7273 def perform ( *args )
73- send_events ( *args )
74+ events , dropped = args
75+ send_events ( events || [ ] , dropped || 0 )
7476 end
7577
7678 private
7779
78- def send_events ( events , dropped = 0 )
79- events ||= [ ]
80+ def send_events ( events , dropped )
81+ return if events . empty?
8082
8183 if dropped . positive?
82- logger . debug do
83- "OpenFeature: Exposure worker dropped #{ dropped } event(s) due to full buffer"
84- end
84+ logger . debug { "OpenFeature: Exposure worker dropped #{ dropped } event(s) due to full buffer" }
8585 end
8686
87- return if events . empty?
88-
8987 payload = Batch . new ( context : @context_builder . call , exposures : events ) . to_h
9088 send_payload ( payload )
9189 end
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ module Datadog
3838
3939 def perform : (*untyped ) -> void
4040
41- def send_events : (::Array[Exposures::Event]? , ::Integer) -> void
41+ def send_events : (::Array[Exposures::Event], ::Integer) -> void
4242
4343 def send_payload : (::Hash[::Symbol, untyped ]) -> Core::Transport::Response?
4444 end
You can’t perform that action at this time.
0 commit comments