Skip to content

Commit

Permalink
Adding timeout opt-out to the example
Browse files Browse the repository at this point in the history
  • Loading branch information
joelgriffith committed Aug 7, 2019
1 parent d3aca80 commit 0edff8c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ function extraSlowJob (cb) {
extraSlowJob.timeout = 500
q.push(extraSlowJob)

// jobs can also opt-out of the timeout altogether
function superSlowJob (cb) {
setTimeout(function () {
console.log('super slow job finished')
cb()
}, 1000)
}

superSlowJob.timeout = null
q.push(superSlowJob)

// get notified when jobs complete
q.on('success', function (result, job) {
console.log('job finished processing:', job.toString().replace(/\n/g, ''))
Expand Down

0 comments on commit 0edff8c

Please sign in to comment.