문제

Capistrano를 사용하여 Memcache를 사용하는 컴퓨터에 앱을 배포합니다. Capistrano가 새 버전의 사이트를 배포 할 때 Memcache를 지우기를 원합니다.

도움이 되었습니까?

해결책

이 요점을 살펴보면 문제가 해결됩니다. https://gist.github.com/matthuhiggins/668744

다른 팁

Capistrano를 모르지만, 당신은 단지 Memcached Process를 죽이고 새로운 과정을 스폰 할 수 없습니까? 파편화를 제거하는 데 더 좋습니다.

이것은 Susan Potter에 의해 꽤 좋아 보인다 https://gist.github.com/rays/154570

# 2007 Copyright Susan Potter <me at susanpotter dot net>
# You can read her software development rants at: http://geek.susanpotter.net
# Released under CreativeCommons-attribution-noncommercial-sharealike license:
# http://creativecommons.org/licenses/by-nc-sa/1.0/
namespace :memcached do
  desc "Restart the Memcache daemon"
  task :restart, :roles => :app do
    deploy.memcached.stop
    deploy.memcached.start
  end

  desc "Start the Memcache daemon"
  task :start, :roles => :app do
    invoke_command "memcached -P #{current_path}/log/memcached.pid  -d", :via => run_method
  end

  desc "Stop the Memcache daemon"
  task :stop, :roles => :app do
    pid_file = "#{current_path}/log/memcached.pid"
    invoke_command("killall -9 memcached", :via => run_method) if File.exist?(pid_file)
  end
end
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top