Class: Bugwatch::DbQuerySender
- Inherits:
-
Object
- Object
- Bugwatch::DbQuerySender
- Defined in:
- lib/bugwatch/db_query_sender.rb
Constant Summary collapse
- TIMEOUT =
3
Instance Method Summary collapse
-
#initialize(config: Bugwatch.configuration) ⇒ DbQuerySender
constructor
A new instance of DbQuerySender.
- #send_batch(grouped_payloads) ⇒ Object
Constructor Details
#initialize(config: Bugwatch.configuration) ⇒ DbQuerySender
Returns a new instance of DbQuerySender.
9 10 11 |
# File 'lib/bugwatch/db_query_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/db_query_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 post_batch(grouped_payloads) rescue StandardError # Fire-and-forget: swallow all errors end end |