Created
April 9, 2016 08:57
-
-
Save VitalySalnikov/b7c5740c8d1390ff35779ba722843b4e to your computer and use it in GitHub Desktop.
Delete all the keys of the currently selected Redis's DB. Rake task.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :redis do | |
desc "Delete all the keys of the currently selected Redis's DB." | |
task :flushdb => :environment do | |
command = ["redis-cli", "-n", CONFIG[:redis][:db].to_s, "flushdb"] | |
puts "EXECUTING: #{command.join(' ')}" | |
system(*command) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment