Report abuse

namespace :memcache do
  desc "Stop memcached"
  task :stop, :roles => :app do
    invoke_command "RAILS_ENV=#{rails_env} ruby #{current_path}/script/memcached_ctl stop", :via => run_method
  end

  desc "Start memcached"
  task :start, :roles => :app do
    invoke_command "RAILS_ENV=#{rails_env} ruby #{current_path}/script/memcached_ctl start", :via => run_method
  end

  desc "Restart memcached"
  task :restart, :roles => :app do
    invoke_command "RAILS_ENV=#{rails_env} ruby #{current_path}/script/memcached_ctl restart", :via => run_method
  end
end

after  "deploy:stop",    "memcache:stop"
before "deploy:start",   "memcache:start"

before "deploy:restart", "memcache:stop"
after  "deploy:restart", "memcache:start"