Skip to content

Instantly share code, notes, and snippets.

@VitalySalnikov
Created April 9, 2016 08:57
Show Gist options
  • Save VitalySalnikov/b7c5740c8d1390ff35779ba722843b4e to your computer and use it in GitHub Desktop.
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.
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