rabid_mq 0.1.26 → 0.1.27

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
  SHA1:
3
- metadata.gz: cf75bf95ea6955263acf5162a6f7ab96e9a3111b
4
- data.tar.gz: f01b7e62e790d609f5b5c90f1d0d864190a41114
3
+ metadata.gz: 9ecfc5d583d6f32ad05bcd185929cea38fb263a2
4
+ data.tar.gz: 073e20e425e6d9f65c70e58a19b6be6bb1110538
5
5
  SHA512:
6
- metadata.gz: 7a64a26fc52a85f34a8688b640624f7666542ba69a8d2e0b7382bbd92089545340112f1a2ce850e55078b499abc0ec5252e9968a1fc515f3d319c09ccd2f00e2
7
- data.tar.gz: c2e711e7cca723080531fd1156be2adf76fd9a1a2b97e15afbaa449268ec1037866b44e44da3bbc423637b437c666fdf7bff9d69475e354f94fb2b24fa202f32
6
+ metadata.gz: 768a52eb709f83a269851fe99e9ff80730605f90aeda9513714b25bd2c6b7abbcffde211cf655383cb10079df80367194867249f2f8f881e11a4147c600e44ae
7
+ data.tar.gz: acda51a5b5dd9e2591636fea705315ff5f38b2f8d6c238eaa11d3c278bb8a41762bd8d34da2da51062ddb090b04a110602e28351406eaa0581d43ff0c68230f8
@@ -27,7 +27,11 @@ module RabidMQ
27
27
  exchange = topic_exchange(topic)
28
28
  exchange.publish(payload, routing_key: routing_key)
29
29
  rescue => e
30
- Rails.logger.error e.message
30
+ if defined? ::Rails
31
+ Rails.logger.error e.message
32
+ else
33
+ puts e.message
34
+ end
31
35
  end
32
36
 
33
37
  unless method_defined? :broadcast
@@ -66,7 +70,7 @@ module RabidMQ
66
70
  def name_with_env(name)
67
71
  return name unless defined?(::Rails)
68
72
  return name if name.match /\[(development|test|production|integration|pod)\]/
69
- name + "[#{Rails.env}]"
73
+ name + "[#{Config.environment}]"
70
74
  end
71
75
 
72
76
  # Provide a new or existing Bunny::Session
@@ -1,3 +1,3 @@
1
1
  module RabidMQ
2
- VERSION = "0.1.26"
2
+ VERSION = "0.1.27"
3
3
  end
data/lib/rabid_mq.rb CHANGED
@@ -28,6 +28,10 @@ module RabidMQ
28
28
  def channel
29
29
  @channel ||= connect.create_channel
30
30
  rescue Bunny::ChannelAlreadyClosed => e
31
+ reconnect
32
+ end
33
+
34
+ def reconnect
31
35
  @channel = nil
32
36
  channel
33
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabid_mq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.26
4
+ version: 0.1.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyrone Wilson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-26 00:00:00.000000000 Z
11
+ date: 2018-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny