Graceful Shutdown (MisskeyIO#156)
--------- Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>
This commit is contained in:
@@ -173,13 +173,12 @@ export class StreamingApiServerService {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public detach(): Promise<void> {
|
||||
public detach(): void {
|
||||
if (this.#cleanConnectionsIntervalId) {
|
||||
clearInterval(this.#cleanConnectionsIntervalId);
|
||||
this.#cleanConnectionsIntervalId = null;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
this.#wss.close(() => resolve());
|
||||
});
|
||||
this.#wss.close();
|
||||
this.#wss.clients.forEach(client => client.terminate());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user