Class: Bugwatch::HttpCallSender
- Inherits:
-
Object
- Object
- Bugwatch::HttpCallSender
- Defined in:
- lib/bugwatch/http_call_sender.rb
Constant Summary collapse
- TIMEOUT =
3
Instance Method Summary collapse
-
#initialize(config: Bugwatch.configuration) ⇒ HttpCallSender
constructor
A new instance of HttpCallSender.
- #send_batch(grouped_payloads) ⇒ Object
Constructor Details
#initialize(config: Bugwatch.configuration) ⇒ HttpCallSender
Returns a new instance of HttpCallSender.
9 10 11 |
# File 'lib/bugwatch/http_call_sender.rb', line 9 def initialize(config: Bugwatch.configuration) @config = config end |
Instance Method Details
#send_batch(grouped_payloads) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bugwatch/http_call_sender.rb', line 13 def send_batch(grouped_payloads) return if grouped_payloads.empty? return unless @config.api_key return unless @config.endpoint Thread.new do Bugwatch.without_tracking { post_batch(grouped_payloads) } rescue StandardError # Fire-and-forget: swallow all errors end end |