bin/czindexer in code_zauker-0.0.7 vs bin/czindexer in code_zauker-0.0.8
- old
+ new
@@ -41,11 +41,15 @@
opts.on( '-h', '--help', 'Display this screen' ) do
puts opts
exit
end
- #TODO ADD REMOVE ALL option
+ options[:check_index]=false
+ opts.on( '-c', '--check-index', 'Do a sanity check of the index before starting') do
+ options[:check_index]=true
+ end
+
end
optparse.parse!
require 'code_zauker'
@@ -96,10 +100,17 @@
end
end
end
+################# MAIN STARTS HERE
+if options[:check_index]
+ fixConn=Redis.new(:host => options[:redis_host], :port => options[:redis_port], :password=> options[:redis_password])
+ im=CodeZauker::IndexManager.new(fixConn)
+ im.check_repair()
+ exit
+end
begin
$CUMULATED_TIME=0
# Allocated here to recycle connection
redisConnection=Redis.new(:host => options[:redis_host], :port => options[:redis_port], :password=> options[:redis_password])