lib/insque.rb in insque-0.7.0 vs lib/insque.rb in insque-0.7.1
- old
+ new
@@ -36,15 +36,11 @@
def self.logger= l
@logger = l
end
def self.logger
- unless @logger
- @logger = JsonLogger.new(STDOUT)
- @logger.additional_fields = { tag: 'insque' }
- end
- @logger
+ @logger ||= JsonLogger.new STDOUT, additional_fields: { tag: 'insque' }
end
def self.redis_class= klass
@redis_class = klass
end
@@ -148,11 +144,11 @@
result = redis.multi do |r|
restart.each {|m| r.lpush inbox, m.to_json }
delete.each {|m| r.lrem processing, 0, m }
end
if result
- errors.each {|m| logger.info deleting: m }
- restart.each {|m| logger.info restarting: m }
+ errors.each {|m| logger.debug deleting: m }
+ restart.each {|m| logger.debug restarting: m }
logger.info cleaning: 'success', inbox: inbox
else
logger.info cleaning: 'failed', inbox: inbox
end
sleep(Random.rand((inbox_ttl.to_f / 10).ceil) + 1)