wankdanker / node-discover

Automatic and decentralized discovery and monitoring of nodejs instances with built in support for a variable number of master processes, service advertising and channel messaging.
229 stars 59 forks source link

Masters Required count doesn't include self #4

Closed solgarius closed 10 years ago

solgarius commented 10 years ago

I have noticed that if I set mastersRequired to 1, it will allow up to 2 masters as the master count when processing a new master does not include self.me.isMaster in the count.

I presume this is not expected behaviour?

wankdanker commented 10 years ago

I agree. I'll fix this.

wankdanker commented 10 years ago

Published v0.0.10 to npm. I added examples/master.js which when run, you can enter promote/demote commands from a command line. You should then be able to see the promotions/demotions now work out.

I think this bug came about because I was originally keeping track of the local node within the .nodes hash. At some point I must have removed it and not updated the master check.

Let me know if you find anything else.

Thanks,

Dan

solgarius commented 10 years ago

Great thanks, that fixed the issue.