Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/logtail/log_devices/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ def flush
# Closes the log device, cleans up, and attempts one last delivery.
def close
# Kill the flush thread immediately since we are about to flush again.
@flush_thread.kill if @flush_thread
@flush_thread.kill.join if @flush_thread

# Flush all remaining messages
flush

# Kill the request queue thread. Flushing ensures that no requests are pending.
@request_outlet_thread.kill if @request_outlet_thread
@request_outlet_thread.kill.join if @request_outlet_thread
end

def deliver_one(msg)
Expand Down
2 changes: 0 additions & 2 deletions spec/logtail/log_devices/http_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@
http.send(:ensure_flush_threads_are_started)
http.close
thread = http.instance_variable_get(:@flush_thread)
sleep 0.1 # too fast!
expect(thread).to_not be_alive
thread = http.instance_variable_get(:@request_outlet_thread)
sleep 0.1 # too fast!
expect(thread).to_not be_alive
end

Expand Down
Loading