Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADDED] Ability to express the max_file_store and max_memory_store as a string (100M, etc..) #2777

Merged
merged 5 commits into from Jan 13, 2022

Conversation

hooksie1
Copy link
Contributor

Resolves #2754

Changes proposed in this pull request:

  • Adds a function to check if max_file_store is a string or int64. Possibly could be reused again.

/cc @nats-io/core

Checks the suffix of the string to create the size of the int64
server/opts.go Outdated Show resolved Hide resolved
server/opts.go Outdated Show resolved Hide resolved
server/opts.go Outdated Show resolved Hide resolved
server/opts.go Outdated Show resolved Hide resolved
server/opts_test.go Show resolved Hide resolved
server/opts.go Outdated Show resolved Hide resolved
Rename function
More easily read math
merged functions together
Changed from predefining error
Fix empty string issue
use same function for max mem store
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

Sorry for the requests to change again, but I did not notice it during the first review.

server/opts.go Outdated Show resolved Hide resolved
Removes switch statement and uses map for finding correct multiple

Also uses ParseInt instead of Atoi for getting string integer.
@hooksie1
Copy link
Contributor Author

No problem at all, that's much cleaner than what I had initially. Thanks for the really helpful input!

@kozlovic kozlovic changed the title Check if value is string or int64 [ADDED] Ability to express the max_file_store and max_memory_store as a string (100M, etc..) Jan 13, 2022
Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM

@kozlovic
Copy link
Member

@hooksie1 Thank you for the contribution!

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.

The "max_file_store" option cannot be quoted
2 participants