尝试做类似的事情:
task :refresh_leads do
"bundle exec runner 'Leads.refresh'"
end
after :deploy, "runner refresh_leads"
这会返回成功但实际上并不运行。在部署之后,有人能指出我对跑步者任务的示例吗?
试试这个 :
namespace :deploy do
desc 'Refresh Leads'
task :refresh_leads do
on roles(:app), in: :sequence, wait: 5 do
runner "Leads.refresh"
end
end
end
# The above restart task is not run by default
# Uncomment the following line to run it on deploys if needed
after 'deploy:publishing', 'deploy:refresh_leads'