运行puma:在部署开始和结束时重新启动无法正常工作

时间:2019-12-16 13:58:55

标签: ruby-on-rails capistrano puma

跑步 * capistrano3-彪马(3.1.1) * Capistrano(3.11.2) *滑轨5.2.0 *红宝石2-5-3

在部署Rails应用程序时,我似乎无法摆脱这个错误

Capistrano tasks may only be invoked once. Since task `puma:restart' was previously invoked, invoke("puma:restart") at /Users/h.bento/.rvm/gems/ruby-2.5.3@stsites/gems/capistrano3-puma-3.1.1/lib/capistrano/tasks/puma.rake:96 will be skipped.
If you really meant to run this task again, use invoke!("puma:restart")

在deploy.rb文件的末尾,我有以下代码,如建议的here和此处

namespace :deploy do
  desc 'Restart application'
  task :restart_please do
    on roles(:app), in: :sequence, wait: 5 do
      invoke!('puma:restart')
    end
  end
end

before 'deploy:starting', 'deploy:restart_please'
after 'deploy:finishing', 'deploy:restart_please'

第一个restart_please可以正常工作。最终的重启似乎是从自动puma:restart而不是我指定的deploy:finishing挂钩中触发的。无论如何,有没有抑制最后的自动puma:restart以便我的任务开始执行?

我确实在capistrano-puma中看到一个未解决的问题,我认为人们已经解决了这个问题,所以我想我可能会遗漏一些东西。

0 个答案:

没有答案