标签: ruby-on-rails clockwork
我想在每个月初都运行任务。 E.g:
2017-01-01 00:00:00 // January has just started 2017-02-01 00:00:00 // February has just started ... ...
如何使用发条做到这一点?
答案 0 :(得分:4)
使用:
every(1.day, 'myjob', at: '00:00', :if => lambda { |t| t.day == 1 }) do ... end