MXS-2329 Make duration misuse harder
Now the desired type must be specified when getting a duration. The type also dictates how durations without suffixes should be interpreted. That removes the need for remembering that to convert a returned millisecond duration to a second duration.
This commit is contained in:
@ -1947,8 +1947,9 @@ uint64_t MXS_CONFIG_PARAMETER::get_size(const std::string& key) const
|
||||
return intval;
|
||||
}
|
||||
|
||||
std::chrono::milliseconds MXS_CONFIG_PARAMETER::get_duration(const std::string& key,
|
||||
mxs::config::DurationInterpretation interpretation)
|
||||
std::chrono::milliseconds
|
||||
MXS_CONFIG_PARAMETER::get_duration_in_ms(const std::string& key,
|
||||
mxs::config::DurationInterpretation interpretation)
|
||||
const
|
||||
{
|
||||
string value = get_string(key);
|
||||
|
||||
Reference in New Issue
Block a user