1

您可以动态安排如下:

name = 'send_emails'
config = {}
config[:class] = 'SendEmail'
config[:args] = 'POC email subject'
config[:every] = ['1h', {first_in: 5.minutes}]
config[:persist] = true
Resque.set_schedule(name, config)

我想做的是安排第一个在午夜运行(无需计算 first_in 偏移量)。

谢谢!

4

1 回答 1

1

没有阅读足够接近的文档:)您也可以:cron在动态时间表中设置:

name = 'send_emails'
config = {}
config[:class] = 'SendEmail'
config[:args] = 'POC email subject'
config[:cron] = '*/15 * * * *'
config[:persist] = true
Resque.set_schedule(name, config)
于 2015-10-30T21:51:33.383 回答