noblesamurai/node-pg-jobs

Jobs are written to DB even if processIn is null

Closed this issue · 1 comments

I want to use the job queue to handle non-continuous jobs.

Maybe I don't understand the purpose of it correctly, but could you please explain why jobs are written into the database when I pass no processIn property, like this:

process: (id, job, done) ->
  # do stuff with job

  console.log "please dont reschedule ", job

  done(null, {}, null)

It results in writing a database record which has no process_at and processed value. This new record will never be scheduled (which is correct in my use-case). I think this record should not be created.

Thanks

The job_snapshots table has one entry per snapshot of the job through its lifecycle. So it is correct and intended that an entry is written which will contain the final payload and will not have a processIn... Just to cover things off so we know the job is complete... :) Hope that helps. Let us know if you have more questions.