Skip to content

Commit 051dfa8

Browse files
committed
add
1 parent f27b050 commit 051dfa8

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

src/Options/Definitions.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,18 @@ module.exports.DatabaseOptions = {
11631163
action: parsers.booleanParser,
11641164
default: false,
11651165
},
1166+
heartbeatFrequencyMS: {
1167+
env: 'PARSE_SERVER_DATABASE_HEARTBEAT_FREQUENCY_MS',
1168+
help:
1169+
'The MongoDB driver option to specify the frequency in milliseconds at which the driver checks the state of the MongoDB deployment.',
1170+
action: parsers.numberParser('heartbeatFrequencyMS'),
1171+
},
1172+
maxIdleTimeMS: {
1173+
env: 'PARSE_SERVER_DATABASE_MAX_IDLE_TIME_MS',
1174+
help:
1175+
'The MongoDB driver option to specify the amount of time in milliseconds that a connection can remain idle in the connection pool before being removed and closed.',
1176+
action: parsers.numberParser('maxIdleTimeMS'),
1177+
},
11661178
maxPoolSize: {
11671179
env: 'PARSE_SERVER_DATABASE_MAX_POOL_SIZE',
11681180
help:
@@ -1198,6 +1210,12 @@ module.exports.DatabaseOptions = {
11981210
'The duration in seconds after which the schema cache expires and will be refetched from the database. Use this option if using multiple Parse Servers instances connected to the same database. A low duration will cause the schema cache to be updated too often, causing unnecessary database reads. A high duration will cause the schema to be updated too rarely, increasing the time required until schema changes propagate to all server instances. This feature can be used as an alternative or in conjunction with the option `enableSchemaHooks`. Default is infinite which means the schema cache never expires.',
11991211
action: parsers.numberParser('schemaCacheTtl'),
12001212
},
1213+
serverSelectionTimeoutMS: {
1214+
env: 'PARSE_SERVER_DATABASE_SERVER_SELECTION_TIMEOUT_MS',
1215+
help:
1216+
'The MongoDB driver option to specify the amount of time in milliseconds for a server to be considered suitable for selection.',
1217+
action: parsers.numberParser('serverSelectionTimeoutMS'),
1218+
},
12011219
socketTimeoutMS: {
12021220
env: 'PARSE_SERVER_DATABASE_SOCKET_TIMEOUT_MS',
12031221
help:

src/Options/docs.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Options/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,12 @@ export interface DatabaseOptions {
624624
minPoolSize: ?number;
625625
/* The MongoDB driver option to set the maximum number of opened, cached, ready-to-use database connections maintained by the driver. */
626626
maxPoolSize: ?number;
627+
/* The MongoDB driver option to specify the amount of time in milliseconds for a server to be considered suitable for selection. */
628+
serverSelectionTimeoutMS: ?number;
629+
/* The MongoDB driver option to specify the amount of time in milliseconds that a connection can remain idle in the connection pool before being removed and closed. */
630+
maxIdleTimeMS: ?number;
631+
/* The MongoDB driver option to specify the frequency in milliseconds at which the driver checks the state of the MongoDB deployment. */
632+
heartbeatFrequencyMS: ?number;
627633
/* The MongoDB driver option to specify the amount of time, in milliseconds, to wait to establish a single TCP socket connection to the server before raising an error. Specifying 0 disables the connection timeout. */
628634
connectTimeoutMS: ?number;
629635
/* The MongoDB driver option to specify the amount of time, in milliseconds, spent attempting to send or receive on a socket before timing out. Specifying 0 means no timeout. */

types/Options/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ export interface DatabaseOptions {
234234
maxStalenessSeconds?: number;
235235
minPoolSize?: number;
236236
maxPoolSize?: number;
237+
serverSelectionTimeoutMS?: number;
238+
maxIdleTimeMS?: number;
239+
heartbeatFrequencyMS?: number;
237240
connectTimeoutMS?: number;
238241
socketTimeoutMS?: number;
239242
autoSelectFamily?: boolean;

0 commit comments

Comments
 (0)