You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the call to self.watch a few lines later will do getChildren again anyway. It's normally harmless because the data will be the same each call, but they could be different, and I'm not sure if there's a scenario where that might cause some kind of race condition, like if children are changing frequently.
If this could potentially cause a problem I'd love to understand how, though. Hence I'm creating this issue instead of just fixing it. Perhaps it's solving a problem I hadn't thought of and isn't a mistake.
Thanks!
The text was updated successfully, but these errors were encountered:
If I understand correctly, this call to getChildren is not necessary:
https://github.com/yunong/node-leader/blob/master/election.js#L313
Because the call to
self.watch
a few lines later will do getChildren again anyway. It's normally harmless because the data will be the same each call, but they could be different, and I'm not sure if there's a scenario where that might cause some kind of race condition, like if children are changing frequently.If this could potentially cause a problem I'd love to understand how, though. Hence I'm creating this issue instead of just fixing it. Perhaps it's solving a problem I hadn't thought of and isn't a mistake.
Thanks!
The text was updated successfully, but these errors were encountered: