INNER CODE UNIT · TypeScript
monitorConnections
tot-ra/graphql-schema-registry · src/index.ts:15
function monitorConnections() {
if (!server) {
return null;
}
server.getConnections((error, count) => {
if (error) {
logger.info(error, `Error occured while getting connections`);
}
logger.info(`Process shutting down with ${count} open connections\n`);
if (count > 0 && shutdownTry < 5) {
shutdownTry++;
setTimeout(() => monitorConnections(), 1000);
}
});
}