4

我想在每个月初运行任务。例如:

2017-01-01 00:00:00 // January has just started
2017-02-01 00:00:00 // February has just started ...
...

如何使用发条来做到这一点?

4

1 回答 1

7

利用:

every(1.day, 'myjob', at: '00:00', :if => lambda { |t| t.day == 1 }) do ... end
于 2016-10-05T07:50:15.657 回答