我在铁轨中使用延迟工作。现在,
我可以使用run_at 1.minutes.from_now。它工作正常。但根据我的要求,时间应该从特定时间计算,如下面代码中的start_time。
在控制器级别
Delayed::Job.enqueue DeviceJob.new(msg), :run_at => msg.start_time
在模型级别
class DeviceJob < Struct.new(:msg)
def perform
# something code
end
end
但是在这种情况下,run_at会添加延迟的作业,但在那个时候它将不会处理。 我没有在延迟工作中使用任何其他方法而不是run_at。
我正在使用MongoDB(Nosql数据库)