Skip to content

Commit

Permalink
feat: set maxTimeMS to 5s default
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Feb 5, 2023
1 parent e12ce59 commit 2f0dada
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ You should use [@ladjs/graceful][lad-graceful] to manage process SIGHUP and grac
| `debug` | Boolean | If `process.env.MONGOOSE_DEBUG` is truthy, then it is `true`, otherwise `false` | set with [mongoose.set][mongoose.set] |
| `id` | Boolean | undefined | set with [mongoose.set][mongoose.set] |
| `timestamps.createdAt.immutable` | Boolean | undefined | set with [mongoose.set][mongoose.set] |
| `maxTimeMS` | Boolean | undefined | set with [mongoose.set][mongoose.set] |
| `maxTimeMS` | Number | `5000` | set with [mongoose.set][mongoose.set] |
| `objectIdGetter` | Boolean | undefined | set with [mongoose.set][mongoose.set] |
| `overwriteModels` | Boolean | undefined | set with [mongoose.set][mongoose.set] |
| `returnOriginal` | Boolean | undefined | set with [mongoose.set][mongoose.set] |
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class Mongoose {
},
debug: boolean(process.env.MONGOOSE_DEBUG),
strict: true,
strictQuery: false
strictQuery: false,
maxTimeMS: 5000 // default 5s timeout for a query to complete
},
config
);
Expand Down

0 comments on commit 2f0dada

Please sign in to comment.