diff options
| author | mo khan <mo@mokhan.ca> | 2015-10-31 08:30:14 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-10-31 08:30:14 -0600 |
| commit | 02a6e895298cc6aa44d518e08cfc4a0c5d7e1eb8 (patch) | |
| tree | aae5965e5f14cbd54ddba2ff62cae8985a0160c4 | |
| parent | 7e171ab84fb32a2bbec526b4416453bbc29bc5bc (diff) | |
log errors and fix bug in mongo consumer.
| -rw-r--r-- | lib/killjoy/message_bus.rb | 3 | ||||
| -rw-r--r-- | lib/killjoy/mongo/consumer.rb | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/killjoy/message_bus.rb b/lib/killjoy/message_bus.rb index c2818e6..05b4c2f 100644 --- a/lib/killjoy/message_bus.rb +++ b/lib/killjoy/message_bus.rb @@ -18,7 +18,8 @@ module Killjoy else consumer.work(message) end - rescue + rescue => error + Killjoy.logger.error(error.message) message.reject! if message reject(info) end diff --git a/lib/killjoy/mongo/consumer.rb b/lib/killjoy/mongo/consumer.rb index 9379e3a..b5c14ef 100644 --- a/lib/killjoy/mongo/consumer.rb +++ b/lib/killjoy/mongo/consumer.rb @@ -1,6 +1,8 @@ module Killjoy module Mongo class Consumer < Consumer + attr_reader :mongo_client + def initialize(writers, shard) @mongo_client = Spank::IOC.resolve(:mongo_client) super(writers, shard) |
