refactor app config
This commit is contained in:
parent
0a08914a01
commit
f14b1c7168
@ -218,7 +218,7 @@ public:
|
||||
[[nodiscard]] auto get_value_by_name(const std::string &name) const
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] auto get_version() const -> std::uint64_t { return version_; }
|
||||
[[nodiscard]] auto get_version() const -> std::uint64_t;
|
||||
|
||||
void save();
|
||||
|
||||
|
@ -735,17 +735,17 @@ auto app_config::default_rpc_port(const provider_type &prov) -> std::uint16_t {
|
||||
return PROVIDER_RPC_PORTS.at(static_cast<std::size_t>(prov));
|
||||
}
|
||||
|
||||
auto api_config::get_api_auth() const -> std::string { return api_auth_; }
|
||||
auto app_config::get_api_auth() const -> std::string { return api_auth_; }
|
||||
|
||||
auto api_config::get_api_port() const -> std::uint16_t { return api_port_; }
|
||||
auto app_config::get_api_port() const -> std::uint16_t { return api_port_; }
|
||||
|
||||
auto api_config::get_api_user() const -> std::string { return api_user_; }
|
||||
auto app_config::get_api_user() const -> std::string { return api_user_; }
|
||||
|
||||
auto api_config::get_cache_directory() const -> std::string {
|
||||
auto app_config::get_cache_directory() const -> std::string {
|
||||
return cache_directory_;
|
||||
}
|
||||
|
||||
auto api_config::get_chunk_downloader_timeout_secs() const -> std::uint8_t {
|
||||
auto app_config::get_chunk_downloader_timeout_secs() const -> std::uint8_t {
|
||||
return std::max(static_cast<std::uint8_t>(5U),
|
||||
min_download_timeout_secs_.load());
|
||||
}
|
||||
@ -1238,7 +1238,8 @@ void app_config::set_retry_read_count(std::uint16_t retry_read_count) {
|
||||
set_value(retry_read_count_, retry_read_count);
|
||||
}
|
||||
|
||||
void set_ring_buffer_file_size(std::uint16_t ring_buffer_file_size) {
|
||||
void app_config::set_ring_buffer_file_size(
|
||||
std::uint16_t ring_buffer_file_size) {
|
||||
set_value(ring_buffer_file_size_, ring_buffer_file_size);
|
||||
}
|
||||
|
||||
@ -1263,4 +1264,6 @@ auto app_config::set_value_by_name(const std::string &name,
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
auto app_config::get_version() const -> std::uint64_t { return version_; }
|
||||
} // namespace repertory
|
||||
|
Loading…
x
Reference in New Issue
Block a user