fix(mongodb): set default socketTimeoutMS to 30000ms in MongoClient options to prevent hung operations from holding connections
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-02-26 - 7.0.16 - fix(mongodb)
|
||||
set default socketTimeoutMS to 30000ms in MongoClient options to prevent hung operations from holding connections
|
||||
|
||||
- Adds socketTimeoutMS: 30000 to MongoClient clientOptions in ts/classes.db.ts
|
||||
- Helps prevent hung operations from indefinitely holding connections by enforcing a 30s socket timeout
|
||||
- Non-breaking change (defaults only)
|
||||
|
||||
## 2025-12-01 - 7.0.15 - fix(classes.doc)
|
||||
Avoid emitting instance fields for collection and manager to preserve decorator-defined prototype getters
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartdata',
|
||||
version: '7.0.15',
|
||||
version: '7.0.16',
|
||||
description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ export class SmartdataDb {
|
||||
maxPoolSize: (this.smartdataOptions as any).maxPoolSize ?? 100,
|
||||
maxIdleTimeMS: (this.smartdataOptions as any).maxIdleTimeMS ?? 300000, // 5 minutes default
|
||||
serverSelectionTimeoutMS: (this.smartdataOptions as any).serverSelectionTimeoutMS ?? 30000,
|
||||
socketTimeoutMS: (this.smartdataOptions as any).socketTimeoutMS ?? 30000, // 30 seconds default — prevents hung operations from holding connections
|
||||
retryWrites: true,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user