Skip to content

Commit

Permalink
fix: correct shutdown sequence for http server (ENG-87)
Browse files Browse the repository at this point in the history
  • Loading branch information
DecathectZero committed Jun 14, 2024
1 parent 79b48ad commit 4f0fe13
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ class Server {

/**
* Stop server
* - Stops services first, then server
* - stops accepting new connections, wait for all existing ones to drain, then stop services
*/
async stop() {
// Stop services
await this.serviceManager.stop();

if (this.server) {
this.server.close();
await once(this.server, 'close');
}

// Stop services
await this.serviceManager.stop();
}
}

Expand Down

0 comments on commit 4f0fe13

Please sign in to comment.