mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
Port the unit tests from https://github.com/vercel/nft/tree/941be1cb3b9d38fbc99a8a6f07af568a64ed0f12/test/unit
21 lines
503 B
JavaScript
21 lines
503 B
JavaScript
const { BULL_REDIS_CONNECTION } = process.env
|
|
|
|
if (!BULL_REDIS_CONNECTION) {
|
|
console.log('Skipping bull integration test')
|
|
console.log(
|
|
'Create cache on redislabs.com and export BULL_REDIS_CONNECTION="redis://:password@hostname:port"'
|
|
)
|
|
return
|
|
}
|
|
|
|
const Queue = require('bull')
|
|
const pdfQueue = new Queue('pdf transcoding', BULL_REDIS_CONNECTION)
|
|
|
|
pdfQueue.process(function (job, done) {
|
|
job.progress(42)
|
|
done()
|
|
pdfQueue.close()
|
|
})
|
|
|
|
pdfQueue.add({ pdf: 'http://example.com/file.pdf' })
|