Skip to content

Commit 0f39b7e

Browse files
committed
docs: describe new configuration options
1 parent ef6f81a commit 0f39b7e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ This application can be configured using the following environment variables:
1313
- `PING_INTERVAL`: The interval of time in milliseconds where the ping to the MongoDB instance is done (default: `"1000"`)
1414
- `SLACK_TOKEN`: The Slack token used to send messages to Slack (default: `"secret-token"`)
1515
- `SLACK_CHANNEL`: The Slack channel where the messages will be sent (default: `"mongo-alerts"`)
16+
- `TIMEOUT`: Timeout to perform MongoDB commands (in milliseconds) (default: `"8000"`)
17+
- `CONNECT_TIMEOUT`: Timeout to connect to MongoDB (in milliseconds) (default: value of `TIMEOUT`)
18+
- `SOCKET_TIMEOUT`: Timeout for MongoDB socket (in milliseconds) (default: value of `TIMEOUT`)
19+
- `WAIT_QUEUE_TIMEOUT`: Timeout for MongoDB to get an available thread (in milliseconds) (default: value of `TIMEOUT`)
20+
- `MAX_IDLE_TIME`: Timeout for MongoDB to close an idle connection (in milliseconds) (default: value of `TIMEOUT`)

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const waitQueueTimeoutConfig = process.env.WAIT_QUEUE_TIMEOUT || timeoutConfig;
3333
const waitQueueTimeout = parseInt(waitQueueTimeoutConfig, 10);
3434

3535
// Configuration: timeout for MongoDB to close an idle connection (in milliseconds)
36-
const maxIdleTimeConfig = process.env.CONNECT_TIMEOUT || timeoutConfig;
36+
const maxIdleTimeConfig = process.env.MAX_IDLE_TIME || timeoutConfig;
3737
const maxIdleTime = parseInt(maxIdleTimeConfig, 10);
3838

3939
const slackClient = new WebClient(slackToken);

0 commit comments

Comments
 (0)