lib/weeter/plugins/lib/redis.rb in weeter-0.11.0 vs lib/weeter/plugins/lib/redis.rb in weeter-0.13.0

- old
+ new

@@ -3,15 +3,14 @@ module Weeter module Plugins module Net module Redis def create_redis_client - @redis ||= begin - redis = EM::Hiredis.connect(@config.redis_uri) - redis.callback { Weeter.logger.info "Connected to Redis" } - redis - end + redis = EM::Hiredis.connect(@config.redis_uri) + redis.callback { Weeter.logger.info "Connected to Redis" } + redis.errback { |message| Weeter.logger.err "Failed to connect to Redis: #{message}" } + redis end end end end -end \ No newline at end of file +end