Last active
August 10, 2016 16:10
-
-
Save nclsjstnn/75246377e361cc1229805b62fe114da5 to your computer and use it in GitHub Desktop.
Capistrano task to flush memcached cache.
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 :cache do | |
desc 'Clear memcache' | |
task :clear => :environment do | |
Rails.cache.clear | |
end | |
end |
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
#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