robtweed / ewd-qoper8

Node.js Message Queue and Multi-Process Manager
24 stars 5 forks source link

getWorker improvment #10

Closed killmenot closed 7 years ago

killmenot commented 7 years ago

@robtweed

Please take a look at https://github.com/robtweed/ewd-qoper8/blob/master/lib/master/proto/getWorker.js#L41-L42

What if no worker by pid here? Can we update

worker = this.worker.process[pid];
if (worker.isAvailable) {

to

worker = this.worker.process[pid];
if (worker && worker.isAvailable) {

?

killmenot commented 7 years ago

Same for stopWorker method here https://github.com/robtweed/ewd-qoper8/blob/master/lib/master/proto/stopWorker.js#L33

robtweed commented 7 years ago

Will be included in next build