Skip to content

Commit

Permalink
Logs: change form of address
Browse files Browse the repository at this point in the history
  • Loading branch information
omrilotan committed Jun 18, 2021
1 parent bc7548a commit 52467ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/forceShutdown/index.js
Expand Up @@ -16,11 +16,11 @@ module.exports = ({ server, timeout, logger, onsuccess, onfail, pub }) => new Pr
const connections = await getConnections(server);

if (connections > 0) {
await logger.error(`Closed service forcefully with ${connections} connections.`);
await logger.error(`Close service forcefully with ${connections} connections.`);
await pub(AFTER);
onfail();
} else {
await logger.info('Closed down with no connections');
await logger.info('Close down with no connections');
await pub(AFTER);
onsuccess();
}
Expand Down
8 changes: 4 additions & 4 deletions lib/shutdown/index.js
Expand Up @@ -18,9 +18,9 @@ module.exports = async function shutdown({ server, timeout, logger, sockets, ons

server.shuttingDown = true; // eslint-disable-line require-atomic-updates

logger.info(`Started shutdown process with ${await getConnections(server)} connections and timeout of ${timeout} ms`);
logger.info(`Start shutdown process with ${await getConnections(server)} connections and timeout of ${timeout} ms`);

logger.info(`Setting timeout of ${timeout} for ${sockets.size} sockets`);
logger.info(`Set timeout of ${timeout} for ${sockets.size} sockets`);
sockets.forEach(socket => {
socket.on('timeout', () => socket.end());
socket.setTimeout(
Expand All @@ -29,9 +29,9 @@ module.exports = async function shutdown({ server, timeout, logger, sockets, ons
});

try {
logger.info('Asking server to close');
logger.info('Ask server to close');
server.close(async function resolution() {
logger.info('Closed server successfully');
logger.info('Close server successfully');
await pub(AFTER);
onsuccess();
});
Expand Down
20 changes: 10 additions & 10 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@routes/graceful-shutdown",
"version": "2.1.0",
"version": "2.1.1",
"description": "💀 Shut down server gracefully",
"keywords": [
"server",
Expand All @@ -27,15 +27,15 @@
"main": "index.js",
"devDependencies": {
"@lets/wait": "^2.0.2",
"@omrilotan/eslint-config": "^1.1.0",
"abuser": "^2.0.2",
"chai": "^4.2.0",
"deep-equal-in-any-order": "^1.0.21",
"eslint": "^7.0.0",
"eslint-plugin-log": "^1.2.3",
"@omrilotan/eslint-config": "^1.3.0",
"abuser": "^2.0.3",
"chai": "^4.3.4",
"deep-equal-in-any-order": "^1.1.8",
"eslint": "^7.28.0",
"eslint-plugin-log": "^1.2.7",
"express": "^4.17.1",
"mocha": "^8.0.1",
"sinon": "^9.0.1",
"sinon-chai": "^3.3.0"
"mocha": "^9.0.1",
"sinon": "^11.1.1",
"sinon-chai": "^3.7.0"
}
}

0 comments on commit 52467ce

Please sign in to comment.