Class: Bugwatch::TransactionSender

Inherits:
Object
  • Object
show all
Defined in:
lib/bugwatch/transaction_sender.rb

Constant Summary collapse

TIMEOUT =
3

Instance Method Summary collapse

Constructor Details

#initialize(config: Bugwatch.configuration) ⇒ TransactionSender

Returns a new instance of TransactionSender.



9
10
11
# File 'lib/bugwatch/transaction_sender.rb', line 9

def initialize(config: Bugwatch.configuration)
  @config = config
end

Instance Method Details

#send_batch(payloads) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/bugwatch/transaction_sender.rb', line 13

def send_batch(payloads)
  return if payloads.empty?
  return unless @config.api_key
  return unless @config.endpoint

  Thread.new do
    post_batch(payloads)
  rescue StandardError
    # Fire-and-forget: swallow all errors
  end
end