watership 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/lib/watership/consumer.rb +14 -10
- data/lib/watership/version.rb +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: 870eb77a1e03d2d87e67b9903e80425e01ac54e8
|
4
|
+
data.tar.gz: 56926572cda379cf637f13348201af6e6f64a21c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26b25df33472d2fdc990be44b3565963ecffa1b00833881c2ad52f2f3e90cbd1ff4d5d532453ddc20d98757806555950719df0d189dd9f8384f9bbfed0574c43
|
7
|
+
data.tar.gz: 63e160d5238260fce7b0193cf8b526ee44f4a57c90ef051dcc39d551b6368f339f612f9fccb664645cadae57de188a13aae309befd4a79adf224fcd5924d40f2
|
data/CHANGELOG.md
CHANGED
data/lib/watership/consumer.rb
CHANGED
@@ -19,28 +19,28 @@ module Watership
|
|
19
19
|
@consumer.call(JSON.parse(payload))
|
20
20
|
success = true
|
21
21
|
rescue StandardError => exception
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
logger.error "Error thrown in subscribe block"
|
23
|
+
logger.error exception.message
|
24
|
+
logger.error exception.backtrace.join("\n")
|
25
|
+
Airbrake.notify(exception) if defined?(AirBrake)
|
26
|
+
logger.info "Rejecting in rabbit"
|
27
27
|
throw(:terminate)
|
28
28
|
rescue Interrupt => exception
|
29
|
-
|
30
|
-
|
29
|
+
logger.error "Interrupt in subscribe block"
|
30
|
+
logger.warn "Stopped gracefully."
|
31
31
|
throw(:terminate)
|
32
32
|
ensure
|
33
33
|
if success
|
34
|
-
|
34
|
+
logger.info "Acking message"
|
35
35
|
channel.acknowledge(delivery_info.delivery_tag, false)
|
36
36
|
else
|
37
|
-
|
37
|
+
logger.info "Rejecting message"
|
38
38
|
channel.reject(delivery_info.delivery_tag, true)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
42
|
ensure
|
43
|
-
|
43
|
+
logger.info "Closing Channel"
|
44
44
|
channel.close
|
45
45
|
end
|
46
46
|
end
|
@@ -62,5 +62,9 @@ module Watership
|
|
62
62
|
c
|
63
63
|
end
|
64
64
|
end
|
65
|
+
|
66
|
+
def logger
|
67
|
+
@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
68
|
+
end
|
65
69
|
end
|
66
70
|
end
|
data/lib/watership/version.rb
CHANGED