Skip to content

Commit

Permalink
feat(NODE-5189): deprecate tcp keepalive options (#3621)
Browse files Browse the repository at this point in the history
  • Loading branch information
durran authored Apr 13, 2023
1 parent 4b5be21 commit cc7c75a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/cmap/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ export interface ConnectionOptions
credentials?: MongoCredentials;
connectTimeoutMS?: number;
tls: boolean;
/** @deprecated - Will not be able to turn off in the future. */
keepAlive?: boolean;
/** @deprecated - Will not be configurable in the future. */
keepAliveInitialDelay?: number;
noDelay?: boolean;
socketTimeoutMS?: number;
Expand Down
6 changes: 4 additions & 2 deletions src/connection_string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,11 +852,13 @@ export const OPTIONS = {
},
keepAlive: {
default: true,
type: 'boolean'
type: 'boolean',
deprecated: 'Will not be able to turn off in the future.'
},
keepAliveInitialDelay: {
default: 120000,
type: 'uint'
type: 'uint',
deprecated: 'Will not be configurable in the future.'
},
loadBalanced: {
default: false,
Expand Down
7 changes: 5 additions & 2 deletions src/mongo_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,12 @@ export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeC
sslCRL?: string;
/** TCP Connection no delay */
noDelay?: boolean;
/** TCP Connection keep alive enabled */
/** @deprecated TCP Connection keep alive enabled. Will not be able to turn off in the future. */
keepAlive?: boolean;
/** The number of milliseconds to wait before initiating keepAlive on the TCP socket */
/**
* @deprecated The number of milliseconds to wait before initiating keepAlive on the TCP socket.
* Will not be configurable in the future.
*/
keepAliveInitialDelay?: number;
/** Force server to assign `_id` values instead of driver */
forceServerObjectId?: boolean;
Expand Down

0 comments on commit cc7c75a

Please sign in to comment.