lykmapipo / kue-scheduler

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

Unlike Kue job.data is static and cannot be modified from inside jobs #53

Open dinana opened 7 years ago

dinana commented 7 years ago

Unlike Kue job.data is static and cannot be modified from inside jobs.

lykmapipo commented 7 years ago

@dinana i will appreciate more details on this. sample codes will help

dinana commented 7 years ago

I don't have it handy right now, I've moved past this, but if inside a running job you make modifications to the data object of the job, the changes are not saved, in a following run in another job the data would not have the changes done to it.

gmcnaught commented 7 years ago

This is due to how kue-scheduler's unique re-uses the same job for every job rather than limiting to a single instance of a job running and creating a new job on each run.

I had put in a pull-request which changed this behavior so that job data could be updated, but it was reverted.

On Mon, Nov 7, 2016 at 4:49 AM, dinana notifications@github.com wrote:

I don't have it handy right now, I've moved past this, but if inside a running job you make modifications to the data object of the job, the changes are not saved, in a following run in another job the data would not have the changes done to it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lykmapipo/kue-scheduler/issues/53#issuecomment-258790781, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTsf1DCgFtT3Lax1dizZapbL4_8Wj3Uks5q7vQwgaJpZM4KL-C9 .