timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.07k stars 157 forks source link

onComplete Typoes #386

Closed ctaity-treinta closed 1 year ago

ctaity-treinta commented 1 year ago

Hi what is the type of the job in the onComplete handler function?

The type of job variable in the following example?

boss.onComplete(jobName, job => {
    assert.strictEqual(jobId, job.data.request.id)
    assert.strictEqual(job.data.request.data.token, requestPayload.token)
    assert.strictEqual(job.data.response.message, responsePayload.message)
    assert.strictEqual(job.data.response.code, responsePayload.code)

    finished() // test suite completion callback
})

Thanks.

timgit commented 1 year ago

The docs has an example job payload, which is customized for onComplete: https://github.com/timgit/pg-boss/tree/master/docs#oncompletename--options-handler