I'm looking for some engineering creativity to solve a problem on Google App Engine.
I have a small number of jobs that run periodically, but I'd like the jobs to be executed at random times. So instead of running a job every Tuesday at 2:00pm, I'd like it to run every Tuesday "between 2:00pm and 5:00pm".
Currently, I'm using the following algorithm...
I've realized that another solution would be to create a task queue that has a very slow rate, and when the cron job fills the queue, it randomly re-orders the list of tasks before doing so.
Any ideas from App Engine users?
Have a cron job at 2 pm that queues a task with a random countdown between 0 and 3 hours?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With