Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Dec 14, 2020
1 parent 5cd9373 commit 941be64
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 40 deletions.
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[ignore]
.*/node_modules/.*/test/.*
<PROJECT_ROOT>/dist/.*

[options]
types_first=false
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@
]
},
"dependencies": {
"delay": "^4.3.0",
"delay": "^4.4.0",
"express": "^4.17.1",
"http-terminator": "^2.0.2",
"roarr": "^2.15.2",
"serialize-error": "^5.0.0"
"http-terminator": "^2.0.3",
"roarr": "^2.15.4",
"serialize-error": "^7.0.1"
},
"description": "Abstracts readiness, liveness and startup checks and graceful shutdown of Node.js services running in Kubernetes.",
"devDependencies": {
"@ava/babel": "^1.0.1",
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.4",
"@babel/node": "^7.8.4",
"@babel/plugin-transform-flow-strip-types": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/register": "^7.8.3",
"ava": "^3.3.0",
"axios": "^0.19.2",
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/node": "^7.12.10",
"@babel/plugin-transform-flow-strip-types": "^7.12.10",
"@babel/preset-env": "^7.12.10",
"@babel/register": "^7.12.10",
"ava": "^3.14.0",
"axios": "^0.21.0",
"babel-plugin-istanbul": "^6.0.0",
"coveralls": "^3.0.9",
"eslint": "^6.8.0",
"eslint-config-canonical": "^18.1.1",
"flow-bin": "^0.118.0",
"coveralls": "^3.1.0",
"eslint": "^7.15.0",
"eslint-config-canonical": "^24.4.4",
"flow-bin": "^0.140.0",
"flow-copy-source": "^2.0.9",
"get-port": "^5.1.1",
"gitdown": "^3.1.2",
"husky": "^4.2.1",
"nyc": "^15.0.0",
"semantic-release": "^17.0.2",
"sinon": "^8.1.1"
"gitdown": "^3.1.3",
"husky": "^4.3.6",
"nyc": "^15.1.0",
"semantic-release": "^17.3.0",
"sinon": "^9.2.2"
},
"engines": {
"node": ">=10"
Expand Down
24 changes: 12 additions & 12 deletions src/factories/createLightship.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ import {
serializeError,
} from 'serialize-error';
import Logger from '../Logger';
import type {
ConfigurationInputType,
ConfigurationType,
LightshipType,
ShutdownHandlerType,
} from '../types';
import {
SERVER_IS_NOT_READY,
SERVER_IS_NOT_SHUTTING_DOWN,
SERVER_IS_READY,
SERVER_IS_SHUTTING_DOWN,
} from '../states';
import type {
ConfigurationInputType,
ConfigurationType,
LightshipType,
ShutdownHandlerType,
} from '../types';
import {
isKubernetes,
} from '../utilities';
Expand All @@ -33,10 +33,10 @@ const log = Logger.child({

const defaultConfiguration = {
detectKubernetes: true,
gracefulShutdownTimeout: 60000,
port: 9000,
shutdownDelay: 5000,
shutdownHandlerTimeout: 5000,
gracefulShutdownTimeout: 60_000,
port: 9_000,
shutdownDelay: 5_000,
shutdownHandlerTimeout: 5_000,
signals: [
'SIGTERM',
'SIGHUP',
Expand Down Expand Up @@ -142,7 +142,7 @@ export default (userConfiguration?: ConfigurationInputType): LightshipType => {
log.info('received request to shutdown the service');

if (configuration.shutdownDelay) {
log.debug('delaying shutdown handler by %d seconds', configuration.shutdownDelay / 1000);
log.debug('delaying shutdown handler by %d seconds', configuration.shutdownDelay / 1_000);

await delay(configuration.shutdownDelay);
}
Expand Down Expand Up @@ -225,7 +225,7 @@ export default (userConfiguration?: ConfigurationInputType): LightshipType => {
log.warn('process did not exit on its own; investigate what is keeping the event loop active');

configuration.terminate();
}, 1000)
}, 1_000)

// $FlowFixMe
.unref();
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// @flow

export {default as createLightship} from './factories/createLightship';
export {
default as createLightship,
} from './factories/createLightship';
export type {
LightshipType,
} from './types';
4 changes: 3 additions & 1 deletion src/utilities/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @flow

export {default as isKubernetes} from './isKubernetes';
export {
default as isKubernetes,
} from './isKubernetes';
10 changes: 5 additions & 5 deletions test/lightship/factories/createLightship.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @flow

import test from 'ava';
import sinon from 'sinon';
import delay from 'delay';
import axios from 'axios';
import delay from 'delay';
import sinon from 'sinon';
import createLightship from '../../../src/factories/createLightship';
import {
SERVER_IS_NOT_READY,
Expand All @@ -23,7 +23,7 @@ type ServiceStateType = {|
+ready: ProbeStateType,
|};

const getServiceState = async (port: number = 9000): Promise<ServiceStateType> => {
const getServiceState = async (port: number = 9_000): Promise<ServiceStateType> => {
const health = await axios('http://127.0.0.1:' + port + '/health', {
validateStatus: () => {
return true;
Expand Down Expand Up @@ -322,7 +322,7 @@ test('delays shutdown handlers', async (t) => {
const terminate = sinon.stub();

const lightship = createLightship({
shutdownDelay: 1000,
shutdownDelay: 1_000,
terminate,
});

Expand All @@ -342,7 +342,7 @@ test('delays shutdown handlers', async (t) => {

t.is(shutdownHandler.callCount, 0);

await delay(1000);
await delay(1_000);

t.is(shutdownHandler.callCount, 1);

Expand Down

0 comments on commit 941be64

Please sign in to comment.