【问题标题】:Rails - Capistrano - Why the default restart recipe in deploy.rb has "wait: 5"Rails - Capistrano - 为什么 deploy.rb 中的默认重启配方有“等待:5”
【发布时间】:2014-09-08 17:27:59
【问题描述】:
我想知道为什么 Capistrano 3 的 deploy.rb 文件中的默认 :restart 配方有一个 wait: 5 参数?
每次重新启动之间是否有特殊原因要等待 5 秒?
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute :touch, release_path.join('tmp/restart.txt')
end
end
【问题讨论】:
标签:
ruby-on-rails
ruby-on-rails-4
deployment
capistrano
capistrano3
【解决方案1】:
这是在 capistrano 3 的 release notes 中定义的
on :all, in: :sequence, wait: 15 do
# This takes all servers, in sequence and waits 15 seconds between
# each server, this might be perfect if you are afraid about
# overloading a shared resource, or want to defer the asset compilation
# over your cluster owing to worries about load
end
阅读more