lykmapipo / kue-scheduler

A job scheduler utility for kue, backed by redis and built for node.js
246 stars 47 forks source link

Track Scheduled Run Time in data #74

Open gmcnaught opened 7 years ago

gmcnaught commented 7 years ago

In the same way that lastRun is calculated, I would like to add the scheduledRun time to the job object, so that when I go to process it, I can calculate the delay between scheduled time and work pickup time.

I would be glad to implement this feature - I just wanted to put it past you first.

lykmapipo commented 7 years ago

@gmcnaught Sure I will appreciate to see it. Once done let review it. Cause in my deployment there is a neccesity for that feature.

But to make it useful. It will be good if you fire event with the job and time taken to run to make api simple to consume by external process.

Waiting for this.

gmcnaught commented 7 years ago

I started to add this into job.data.scheduled_at, until I saw that the job object has started_at,updated_at,promoted_at as top level items. The difficulty is that on set and get it seems those are heavily filtered - I'd have to curry the job.set and job.get to add this.