api - Scheduling ruby script based on Variable time -


i have general question scheduling scripts.

i'm faced challenge need schedule reminder email x days in advance via api using ruby. however, there no scheduling functionality built api call.

so, idea run ruby script sends first email , @ end schedules separate ruby script run x days in advance. make sense?

the logic like:

email.send(test@test.com) rubyscript.schedule(time.now + x days) 

does make sense? i'm wondering how can schedule ruby script ruby script.

maybe using delayed::job? might overkill, it's super easy...

altering code accordingly:

email.delay(:run_at => 7.days.from_now).send('test@test.com') 

there's whenever, , other cron-like scheduling gems.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -