【问题标题】:Resque scheduler set dynamic to first run at a specific timeResque 调度程序将动态设置为在特定时间首次运行
【发布时间】:2015-10-31 05:51:33
【问题描述】:

您可以如下动态调度:

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 偏移量)。

谢谢!

【问题讨论】:

    标签: ruby resque resque-scheduler


    【解决方案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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-26
      • 1970-01-01
      • 2016-04-07
      • 2020-04-01
      相关资源
      最近更新 更多