Background Jobs
Last updated
const Queue = require('bull');
const jobQueue = new Queue('jobs', process.env.REDIS_JOB_URL);
async function addJob(){
const job = await jobQueue.add({ /* your custom metadata here */ });
}POST /api/jobconst job = await jobQueue.getJob(id);
job.progress('started');PATCH /api/job/:idGET /api/job/:idconst job = await jobQueue.getJob(id);DELETE /api/job/:idconst job = await jobQueue.getJob(req.params.id);
await job.remove();