Sunday 15 September 2013

Rails making new cron jobs based on user input

Rails making new cron jobs based on user input

In my application, I want to invoke an action every two weeks based on
when the user triggered an action. I guess what's confusing is why there
doesn't seem to be a straight forward way of doing this.
Ideally, the repeated job would be set in the model, not some other file.
For example, the whenever gem has these instructions:
Getting started
$ cd /apps/my-great-project
$ wheneverize .
This will create initial config/schedule.rb file for you.
But I don't want to put my schedules in there. I want the schedule to be
in my model. The schedule isn't being set by me, it's being set by my
users.
Is there any straightforward way of implementing this? I've been stumped
on this for weeks.

No comments:

Post a Comment