Skip to content

Commit

Permalink
fix bug in workers.rb flush
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Yiu authored and Tim Yiu committed Aug 23, 2023
1 parent d511d48 commit f402744
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion lib/amplitude/workers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def stop
end

def flush
events = @storage.pull_all
Concurrent::Future.execute do
events = @storage.pull_all
if events && !events.empty?
send(events)
end
Expand Down
1 change: 0 additions & 1 deletion spec/amplitude/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def setup_stub
25.times do |i|
@client.track(BaseEvent.new('test_event', user_id: 'test_user_id', event_properties: { 'id' => i }))
end
sleep(1)
futures = @client.flush
futures.each do |flush_future|
flush_future&.value
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@
add_filter '/spec/'
add_filter '/vendor/'
end

WebMock.disable_net_connect!(allow_localhost: true)

0 comments on commit f402744

Please sign in to comment.