كيف يمكنني مسح ذاكرة التخزين المؤقت باستخدام capistrano؟

StackOverflow https://stackoverflow.com/questions/643470

  •  22-07-2019
  •  | 
  •  

سؤال

أستخدم capistrano لنشر تطبيقي على جهاز يستخدم ذاكرة التخزين المؤقت.أريد أن يقوم capistrano بمسح ذاكرة التخزين المؤقت عندما ينشر إصدارًا جديدًا من الموقع.

هل كانت مفيدة؟

المحلول

ونلقي نظرة على هذه GIST يحل المشكلة: https://gist.github.com/matthuhiggins / 668744

نصائح أخرى

لا أعرف كابيسترانو، ولكن لا يمكن لك مجرد قتل عملية أعطها وتفرخ واحدة جديدة؟ ربما أفضل لإزالة تجزئة أيضا.

هذا من تأليف سوزان بوتر يبدو جيدًا جدًا 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