Rails cron with whenever, setting the environment

前端 未结 10 2104
孤街浪徒
孤街浪徒 2021-01-30 13:15

This question will probably only make sense if you know about the whenever gem for creating cron jobs. I have a task in my schedule.rb like

every 1.day, :at =&g         


        
10条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-30 14:12

    Latest whenever allows easy Capistrano integration. You can add following to deploy.rb:

    set :whenever_environment, defer { stage }
    set :whenever_identifier, defer { "#{application}-#{stage}" }
    
    require "whenever/capistrano"
    

提交回复
热议问题