backend-defaults: immediately close connections on shutdown in local dev
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-defaults': patch
|
||||
---
|
||||
|
||||
Immediately close all connections when shutting down in local development.
|
||||
@@ -53,6 +53,12 @@ export async function createHttpServer(
|
||||
|
||||
stop() {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// Ensure that various polling connections are shut down fast in development
|
||||
server.closeAllConnections();
|
||||
} else {
|
||||
server.closeIdleConnections();
|
||||
}
|
||||
server.close(error => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
Reference in New Issue
Block a user