lykmapipo / kue-scheduler

A job scheduler utility for kue, backed by redis and built for node.js
246 stars 47 forks source link

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

Closed schmod closed 7 years ago

schmod commented 7 years ago

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 } )

lykmapipo commented 7 years ago

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