0

我有这个必须在上午6 点或上午 11 点或下午 16 点或晚上 20 点运行的任务

或至少例如早上 6 点

Resque.enqueue_at <what to put here>, SendSmsJob

我如何定义这样的特定时间?谢谢

4

1 回答 1

0

您可以传递它 a Time,它会在该时间过去后运行,如下所示:

time = Time.new(2016, 6, 11, 20, 0)
Resque.enqueue_at time, SendSmsJob
于 2016-01-12T09:26:07.053 回答