Skip to content

Instantly share code, notes, and snippets.

@nclsjstnn
Last active August 10, 2016 16:10
Show Gist options
  • Save nclsjstnn/75246377e361cc1229805b62fe114da5 to your computer and use it in GitHub Desktop.
Save nclsjstnn/75246377e361cc1229805b62fe114da5 to your computer and use it in GitHub Desktop.
Capistrano task to flush memcached cache.
namespace :cache do
desc 'Clear memcache'
task :clear => :environment do
Rails.cache.clear
end
end
#add somewhere in deploy.rb
namespace :memcached do
desc "Flush memcached"
task :clear do
on roles(:app) do
within release_path do
execute :bundle, :exec, "rake cache:clear RAILS_ENV=#{fetch(:stage)}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment