Skip to content

Conversation

gagik
Copy link
Collaborator

@gagik gagik commented Mar 5, 2025

Because in mongosh (and generally), some of our settings like logRetentionGB can be undefined while others like maxLogFileCount cannot, it's likely users will end up setting multiple of them as Infinity if they're looking to unset different things.

Our code skips some checks when some steps when those limits are undefined but it won't skip if they're infinite so it can be a performance improvement if we skip those steps if their values are infinite as well.

@gagik gagik changed the title feat(mongodb-log-writer): skip checks for retentionGB and `maxLogFi… feat(mongodb-log-writer): skip checks for retentionGB and maxLogFileCount when set to Infinity MONGOSH-2047 Mar 5, 2025
}
}

if (this._options.retentionGB) {
if (hasRetentionGB && this._options.retentionGB) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this is redundant but TypeScript isn't smart enough to do type promotion otherwise

@gagik gagik force-pushed the gagik/skip-infinity-checks branch from 4b3d98a to bfdc854 Compare March 5, 2025 08:40
@gagik gagik force-pushed the gagik/skip-infinity-checks branch from bfdc854 to ad59efa Compare March 5, 2025 08:55
@gagik gagik merged commit 041fab1 into main Mar 5, 2025
6 checks passed
@gagik gagik deleted the gagik/skip-infinity-checks branch March 5, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants