Skip to content

Commit

Permalink
fix(Shard): erroneously returning false
Browse files Browse the repository at this point in the history
The node documentation fails to correctly document when the backlog of unsent messages exceeds a certain threshhold the function will return false. This does not mean it will refuse to send- simply that it will take time. Issue in point: nodejs/node#7657 (comment)
  • Loading branch information
Lewdcario authored and 1Computer1 committed Jul 14, 2018
1 parent 7856962 commit bec29c4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sharding/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,9 @@ class Shard extends EventEmitter {
*/
send(message) {
return new Promise((resolve, reject) => {
const sent = this.process.send(message, err => {
this.process.send(message, err => {
if (err) reject(err); else resolve(this);
});
if (!sent) throw new Error('SHARDING_CHILD_CONNECTION');
});
}

Expand Down

0 comments on commit bec29c4

Please sign in to comment.