Error: Could not remove job
Created by: alolis
Description
I am experiencing the following error whenever I try to remove a job:
2018-10-23T14:08:46.619Z - debug: Error: Could not remove job 1
at /myproject/node_modules/bull/lib/job.js:392:15
From previous event:
at /myproject/node_modules/bull/lib/job.js:388:42
at runCallback (timers.js:637:20)
at tryOnImmediate (timers.js:610:5)
at processImmediate [as _immediateCallback] (timers.js:582:5)
Minimal, Working Test code to reproduce the issue.
I am using the sandboxed environment and the issue is reproducible even with a simple processor like so:
// processor.js
module.exports = function myProcessor(job, done) {
setTimeout(() => {
done();
}, 60000);
}
// normal code
import Queue from 'bull';
const queue = new Queue('myQueue');
queue.process('/path/to/my/processor.js');
await queue.add({foo: 'bar'}, {uuid: 1});
const job = await queue.getJob(1);
await job.remove(); // error here
Bull version
I am using Node.js v6.9.1 with bull v3.4.8 and redis-server v3.0.7
Also by looking at this I understand that I can remove jobs while in progress. Is this true? What is the correct way to force remove a job if indeed true?
Thank you for your time.