mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add rubocop to our build. (#5004)
This commit is contained in:
@@ -125,10 +125,10 @@ class DiscourseRedis
|
||||
end
|
||||
|
||||
def self.slave_config(options = config)
|
||||
options.dup.merge!({ host: options[:slave_host], port: options[:slave_port] })
|
||||
options.dup.merge!(host: options[:slave_host], port: options[:slave_port])
|
||||
end
|
||||
|
||||
def initialize(config=nil)
|
||||
def initialize(config = nil)
|
||||
@config = config || DiscourseRedis.config
|
||||
@redis = DiscourseRedis.raw_connection(@config)
|
||||
end
|
||||
@@ -182,7 +182,7 @@ class DiscourseRedis
|
||||
end
|
||||
|
||||
def mget(*args)
|
||||
args.map!{|a| "#{namespace}:#{a}"}
|
||||
args.map! { |a| "#{namespace}:#{a}" }
|
||||
DiscourseRedis.ignore_readonly { @redis.mget(*args) }
|
||||
end
|
||||
|
||||
@@ -193,10 +193,10 @@ class DiscourseRedis
|
||||
end
|
||||
end
|
||||
|
||||
def keys(pattern=nil)
|
||||
def keys(pattern = nil)
|
||||
DiscourseRedis.ignore_readonly do
|
||||
len = namespace.length + 1
|
||||
@redis.keys("#{namespace}:#{pattern || '*'}").map{
|
||||
@redis.keys("#{namespace}:#{pattern || '*'}").map {
|
||||
|k| k[len..-1]
|
||||
}
|
||||
end
|
||||
@@ -210,7 +210,7 @@ class DiscourseRedis
|
||||
|
||||
def flushdb
|
||||
DiscourseRedis.ignore_readonly do
|
||||
keys.each{|k| del(k)}
|
||||
keys.each { |k| del(k) }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user