refactor shards subscription
This commit is contained in:
parent
3946614b3a
commit
5e61aea368
|
@ -78,6 +78,7 @@ class MessageBroker extends SocketEvents {
|
|||
}
|
||||
if (!this.shards[message]) {
|
||||
console.log(`CLUSTER: Shard ${message} connected`);
|
||||
this.shards[message] = Date.now();
|
||||
await this.subscriber.subscribe(
|
||||
message,
|
||||
(buffer) => this.onShardBinaryMessage(buffer, message),
|
||||
|
@ -85,6 +86,7 @@ class MessageBroker extends SocketEvents {
|
|||
);
|
||||
// immediately give new shards informations
|
||||
this.publisher.publish('bc', this.thisShard);
|
||||
return;
|
||||
}
|
||||
this.shards[message] = Date.now();
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user