MCPcopy
hub / github.com/soketi/soketi / disconnect

Method disconnect

src/rate-limiters/cluster-rate-limiter.ts:77–86  ·  view source on GitHub ↗

* Clear the rate limiter or active connections.

()

Source from the content-addressed store, hash-verified

75 * Clear the rate limiter or active connections.
76 */
77 disconnect(): Promise<void> {
78 return super.disconnect().then(() => {
79 // If the current instance is the master and the server is closing,
80 // demote and send the rate limiter of the current instance to the new master.
81 if (this.server.nodes.get('self').isMaster) {
82 this.server.discover.demote();
83 this.server.discover.send('rate_limiter:limiters', this.rateLimiters);
84 }
85 });
86 }
87
88 /**
89 * Send the stored rate limiters this instance currently have.

Callers

nothing calls this directly

Calls 3

disconnectMethod · 0.65
getMethod · 0.65
sendMethod · 0.65

Tested by

no test coverage detected