lib/splash/backends/redis.rb in prometheus-splash-0.5.0 vs lib/splash/backends/redis.rb in prometheus-splash-0.5.2
- old
+ new
@@ -7,11 +7,11 @@
@hostname = Socket.gethostname
@config = get_config[:backends][:stores][store]
conf = { :host => @config[:host], :port => @config[:port], :db => @config[:base].to_i}
conf[:password] = @config[:auth] if @config[:auth]
@store = ::Redis.new conf
- @redis_cli_cmd = `which redis-cli`
+ #@redis_cli_cmd = `which redis-cli`
@store.auth(@config[:auth]) if @config[:auth]
end
def list(pattern='*', hostname = @hostname)
return @store.keys("#{hostname}##{pattern}").map{|item| item = remove_hostname(item)}
@@ -35,11 +35,11 @@
hostname = (options[:hostname])? options[:hostname] : @hostname
@store.del prefix_hostname(options[:key],hostname)
end
def flush
- `#{@redis_cli_cmd} -n 3 flushdb`
- # @@store.flushdb
+ #`#{@redis_cli_cmd} -n #{@config[:base]} flushdb`
+ @store.flushdb
end
def exist?(options)
hostname = (options[:hostname])? options[:hostname] : @hostname
return ( not @store.get(prefix_hostname(options[:key],hostname)).nil?)