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

[5.0] make read-only-threads defaults clearer in help text #2200

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

spoonincode
Copy link
Member

Resolves #2103

@@ -1071,7 +1074,7 @@ void producer_plugin::set_program_options(
("snapshots-dir", bpo::value<std::filesystem::path>()->default_value("snapshots"),
"the location of the snapshots directory (absolute path or relative to application data dir)")
("read-only-threads", bpo::value<uint32_t>(),
"Number of worker threads in read-only execution thread pool. Max 8.")
("Number of worker threads in read-only execution thread pool. Defaults to 0 if configured as producer, otherwise defaults to "s + std::to_string(producer_plugin_impl::_ro_default_threads_nonproducer) + ". Max "s + std::to_string(producer_plugin_impl::_ro_max_threads_allowed) + "."s).c_str())
Copy link
Member Author

Choose a reason for hiding this comment

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

.c_str()

option_description makes a copy of the char* passed in so this should be okay; not sure what a better pattern may be

Copy link
Contributor

Choose a reason for hiding this comment

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

If option_description did not makes a copy of the char* passed, you could return s.c_str(), s being a static std::string declared in a lambda called immediately, but probably fine as is.

@spoonincode spoonincode merged commit e7df935 into release/5.0 Feb 5, 2024
29 checks passed
@spoonincode spoonincode deleted the rot_defaults_help_50 branch February 5, 2024 15:00
@ericpassmore
Copy link
Contributor

Note:start
group: CLEANCODE
category: INTERNALS
summary: Clearer help text for read-only-threads defaults.
Note: end

@spoonincode spoonincode linked an issue Feb 6, 2024 that may be closed by this pull request
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.

Default read-only-threads could be clearer in the help
4 participants