lykmapipo/kue-scheduler

.shutdown() throws an error when queue created with { worker: false }

Closed this issue · 1 comments

This code:

const Queue = kue.createQueue({ worker: false });
Queue.shutdown(100);

Produces this error:

     Uncaught TypeError: Cannot read property 'removeAllListeners' of undefined
    at Queue.shutdown (index.js:1099:17)

( The cause here is fairly obvious, as Queue._listener is never defined when we pass in { worker: false } )

@schmod I will appreciate a PR with the fix or a spec(test) that fail to aid in fix the issue.