bug_bunny 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: daaffb39ad9bdde817c106114b90ce45b7807b1e77d4c411846506618791bece
4
- data.tar.gz: d578e38d4faf58d2f23514d641ba01a40a43f8f723a9ab4640a2c6cb97c9d657
3
+ metadata.gz: 44a4635e06b113a429bf55f1d1d9d26ecd106fdfe9bd91d2feb975352f5905a1
4
+ data.tar.gz: 1006a577430270652be5f21a8215dea9777f423b85fdc2f699c1903560ea2864
5
5
  SHA512:
6
- metadata.gz: bac312aee21baa512994dadf9807225012b3a3cedb91956df52da97680432d2d955045700d4b2012dbc4ed2a7bf69b5a0d14a7f464fd1ae17001e7d7e0a01420
7
- data.tar.gz: a9e4feea6301be2aadcc5551fcc085caeb36747dc6f2d9d792126f904e29befbbea2433d36b833956a37508cfe3be72d403f2d264656cf86ef3fed453cfd4d23
6
+ metadata.gz: 84699963ef67a52f7c50b0e934818d17ee6fb0e177594d99d4f11fd522e88475cc3bbf229285011e9b5e6e6d92b9225fe1700d796b3778a66eb5b9d7f15badd1
7
+ data.tar.gz: 28e10b78f4def1df46779b0abac6624ee1ead627d0c992c2b3eec97cb770d8344bcce4568eb7e4f5592995fb5970fb1995606523c37a70cfd8e9992680baa590
@@ -17,8 +17,7 @@ module BugBunny
17
17
  :logger,
18
18
  :time_to_wait,
19
19
  :communication_response,
20
- :service_message,
21
- :consume_response
20
+ :service_message
22
21
 
23
22
  def initialize(attrs = {})
24
23
  @logger = Logger.new('./log/bug_bunny.log', 'monthly')
@@ -278,7 +277,7 @@ module BugBunny
278
277
 
279
278
  def make_response
280
279
  if communication_response.success?
281
- consume_response || communication_response
280
+ service_message || communication_response
282
281
  else
283
282
  communication_response.response = communication_response.response.to_s
284
283
  communication_response
@@ -344,41 +343,5 @@ module BugBunny
344
343
  close_connection!
345
344
  raise Exception::ComunicationRabbitError.new(COMUNICATION_ERROR, e.backtrace)
346
345
  end
347
-
348
- def self.health_check(request: nil)
349
- message_to_publish = ::BugBunny::Message.new(service_action: self::SERVICE_HEALTH_CHECK, body: {})
350
-
351
- request ||= self::ROUTING_KEY_SYNC_REQUEST
352
-
353
- begin
354
- service_adapter = new
355
- sync_queue = service_adapter.build_queue(
356
- request,
357
- self::QUEUES_PROPS[self::ROUTING_KEY_SYNC_REQUEST]
358
- )
359
- rescue ::BugBunny::Exception::ComunicationRabbitError => e
360
- (service_adapter ||= nil).try(:close_connection!)
361
- return ::BugBunny::Response.new(status: false, response: e.message)
362
- end
363
-
364
- service_adapter.publish_and_consume!(message_to_publish, sync_queue, check_consumers_count: true)
365
-
366
- service_adapter.close_connection! # ensure the adapter is close
367
-
368
- if service_adapter.communication_response.success?
369
- msg = service_adapter.service_message
370
-
371
- result = case msg.status
372
- when 'success'
373
- { status: true }
374
- when 'error', 'critical'
375
- { status: false }
376
- end
377
-
378
- service_adapter.consume_response = ::BugBunny::Response.new(result)
379
- end
380
-
381
- service_adapter.make_response
382
- end
383
346
  end
384
347
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BugBunny
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bug_bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - gabix