sensu-transport 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sensu/transport/rabbitmq.rb +12 -4
- data/sensu-transport.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2496679cd2381c318009355b8053bc5a6538b38c
|
4
|
+
data.tar.gz: 0ef31ba66257db7ca775231bcd57fcd08558cdb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb087f8e880e4e756d592d801fa781b32f38f3c19fe0aaaec87933e95c97ba84d4a8e649991f72ea6d1ae4623ddb96807830b6b8e6c6107371bab01d32a4a9f6
|
7
|
+
data.tar.gz: 87a36f325889d9bdb440d301d03dcbd56d8249ecc62e9d9e91beb740ec1793204f378945c05451f7ab0029b0b3a4aee0da2823a1c5ef7f4c9d49e617494d76b2
|
@@ -25,9 +25,6 @@ module Sensu
|
|
25
25
|
reconnect_callback = Proc.new { reconnect }
|
26
26
|
@connection.on_tcp_connection_loss(&reconnect_callback)
|
27
27
|
@connection.on_skipped_heartbeats(&reconnect_callback)
|
28
|
-
@connection.on_recovery do
|
29
|
-
@after_reconnect.call
|
30
|
-
end
|
31
28
|
setup_channel(options)
|
32
29
|
end
|
33
30
|
|
@@ -35,7 +32,15 @@ module Sensu
|
|
35
32
|
unless @connection.reconnecting?
|
36
33
|
@connection_timeout.cancel
|
37
34
|
@before_reconnect.call
|
38
|
-
|
35
|
+
timer = EM::PeriodicTimer.new(5) do
|
36
|
+
begin
|
37
|
+
@connection.reconnect(true)
|
38
|
+
rescue EventMachine::ConnectionError
|
39
|
+
end
|
40
|
+
end
|
41
|
+
@connection.on_recovery do
|
42
|
+
timer.cancel
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
41
46
|
|
@@ -128,6 +133,9 @@ module Sensu
|
|
128
133
|
prefetch = options.fetch(:prefetch, 1)
|
129
134
|
end
|
130
135
|
@channel.prefetch(prefetch)
|
136
|
+
@channel.on_recovery do
|
137
|
+
@after_reconnect.call
|
138
|
+
end
|
131
139
|
end
|
132
140
|
end
|
133
141
|
end
|
data/sensu-transport.gemspec
CHANGED