1

You can schedule dynamically as below:

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)

What I'd like to do is schedule the first to run say at midnight (without having to calculate a first_in offset).

thanks!

kreek
  • 8,774
  • 8
  • 44
  • 69

1 Answers1

1

Didn't read the docs close enough :) you can set a :cron in dynamic schedules too:

name = 'send_emails'
config = {}
config[:class] = 'SendEmail'
config[:args] = 'POC email subject'
config[:cron] = '*/15 * * * *'
config[:persist] = true
Resque.set_schedule(name, config)
kreek
  • 8,774
  • 8
  • 44
  • 69