lib/redimap/redis_conn.rb in redimap-0.5.0 vs lib/redimap/redis_conn.rb in redimap-0.6.0

- old
+ new

@@ -8,26 +8,24 @@ @@RESCUE_QUEUE = 'redimap' @@RESCUE_CLASS = 'RedimapJob' def initialize - @logger = Redimap.logger - begin @redis = Redis.connect(:url => Redimap.config.redis_url) @redis.ping rescue Redis::CannotConnectError => e - @logger.error { e.to_s } + Redimap.logger.error { e.to_s } return end @KEYS = { :redimap_mailboxes => "#{Redimap.config.redis_ns_redimap}:mailboxes", - :rescue_queues => "#{Redimap.config.redis_ns_queue}:queues", - :rescue_queue_redimap => "#{Redimap.config.redis_ns_queue}:queue:#{@@RESCUE_QUEUE}", + :resque_queues => "#{Redimap.config.redis_ns_queue}:queues", + :resque_queue_redimap => "#{Redimap.config.redis_ns_queue}:queue:#{@@RESCUE_QUEUE}", }.freeze if block_given? yield self @@ -46,12 +44,12 @@ def set_mailbox_uid(mailbox, uid) @redis.hset(@KEYS[:redimap_mailboxes], mailbox, uid) end def queue_mailbox_uid(mailbox, uid) - @redis.sadd(@KEYS[:rescue_queues], @@RESCUE_QUEUE) + @redis.sadd(@KEYS[:resque_queues], @@RESCUE_QUEUE) - @redis.rpush(@KEYS[:rescue_queue_redimap], payload(mailbox, uid)) + @redis.rpush(@KEYS[:resque_queue_redimap], payload(mailbox, uid)) end private def payload(mailbox, uid)