grantcarthew / node-rethinkdb-job-queue

A persistent job or task queue backed by RethinkDB.
https://github.com/grantcarthew/node-rethinkdb-job-queue/wiki
MIT License
156 stars 16 forks source link

Schedule a job into the future #1

Closed TomKaltz closed 8 years ago

TomKaltz commented 8 years ago

Can you add a job that is set to run not immediately but at a pre-defined time in the future? Similar to how future retries work?

grantcarthew commented 8 years ago

Hi @TomKaltz, I'm away from home with little signal and on my phone. Will look at this in about five days. It is a good idea though. My first thought is to set 'dateRetry' on the new Job object prior to adding it to the queue. This will not work as is though.

grantcarthew commented 8 years ago

This was easier than I thought @TomKaltz. If you had set the dateRetry value on the v0.0.7 package it would have worked. However after your request I decided to rename the dateRetry property to dateEnable. I added a test for delayed jobs and the package has been updated to v0.0.8.

I have written a document to explain how to use the dateEnable property to delay the processing of jobs.