Skip to content

Commit

Permalink
Merge pull request #173 from andrewmolyuk/fix-linter
Browse files Browse the repository at this point in the history
Improve error handling for setParameter command and update ESLint to version 9.9.0
  • Loading branch information
andrewmolyuk authored Aug 17, 2024
2 parents ff4cfdc + 6678c92 commit c005872
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 31 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class Leader extends EventEmitter {
try {
await this.db.admin().command({ setParameter: 1, ttlMonitorSleepSecs: 1 })
} catch (_err) {
console.error('Error on running setParameter command on MongoDB server to enable TTL monitor sleep time to 1 second. This is not a critical error, but it may cause some performance issues.')
console.error(
`Error on running setParameter command on MongoDB server to enable TTL monitor sleep time to 1 second. This is not a critical error, but it may cause some performance issues. Error: ${_err}`
)
}
const cursor = await this.db.listCollections({ name: this.key })
const exists = await cursor.hasNext()
Expand Down
71 changes: 42 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"homepage": "https://github.com/andrewmolyuk/mongo-leader#readme",
"devDependencies": {
"eslint": "^9.5.0",
"eslint": "^9.9.0",
"jest": "^29.7.0"
}
}

0 comments on commit c005872

Please sign in to comment.