Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async gracefulShutdown(signal) {
try {
logger.info(`${signal} received. Closing connections, stopping server`);
await this.app.cleanup();
logger.info('Shutting down');
} catch (err) {
logger.error('Error during graceful shutdown');
logger.error(err);
} finally {
process.exit(0);
}
}
}
public async gracefulShutdown(signal) {
try {
logger.info(`${signal} received. Closing connections, stopping server`);
await this.app.cleanup();
logger.info('Shutting down');
} catch (err) {
logger.error('Error during graceful shutdown');
logger.error(err);
} finally {
process.exit(0);
}
}
}
public async start() {
await this.app.httpServer.startListening(serverPort);
logger.info(`API is now running on port ${serverPort}`);
}
server.listen(serverPort, () => {
logger.info(`Client Server is now running on port ${serverPort}`);
});
server.listen(serverPort, () => {
logger.info(`API is now running on port ${serverPort}`);
});
httpServer.listen(serverPort, () => {
logger.info(`API is now running on port ${serverPort}`);
resolve(httpServer);
});
});