unit tests and fixes
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
parent
a9be30e6e7
commit
df60ac8dfc
@ -115,16 +115,7 @@ private:
|
||||
[[nodiscard]] auto load() -> bool;
|
||||
|
||||
template <typename dest, typename source>
|
||||
auto set_value(dest &dst, const source &src) -> bool {
|
||||
if (dst.load() == src) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dst = src;
|
||||
config_changed_ = true;
|
||||
save();
|
||||
return true;
|
||||
}
|
||||
auto set_value(dest &dst, const source &src) -> bool;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_api_auth() const -> std::string;
|
||||
|
@ -41,7 +41,8 @@ constexpr const auto default_task_wait_ms{100U};
|
||||
constexpr const auto default_timeout_ms{60000U};
|
||||
constexpr const auto max_orphaned_file_retention_days{std::uint16_t(31U)};
|
||||
constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)};
|
||||
constexpr const auto min_cache_size_bytes{100UL * 1024UL * 1024UL};
|
||||
constexpr const auto min_cache_size_bytes{
|
||||
std::uint64_t(100UL * 1024UL * 1024UL)};
|
||||
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)};
|
||||
constexpr const auto min_online_check_retry_secs{std::uint16_t(15U)};
|
||||
constexpr const auto min_orphaned_file_retention_days{std::uint16_t(1U)};
|
||||
|
@ -1239,9 +1239,24 @@ void app_config::set_sia_config(sia_config value) {
|
||||
}
|
||||
|
||||
void app_config::set_task_wait_ms(std::uint16_t value) {
|
||||
std::cout << task_wait_ms_.load() << '|' << value << std::endl;
|
||||
set_value(task_wait_ms_, value);
|
||||
}
|
||||
|
||||
template <typename dest, typename source>
|
||||
auto app_config::set_value(dest &dst, const source &src) -> bool {
|
||||
if (dst.load() == src) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cout << "changed" << std::endl;
|
||||
dst = src;
|
||||
config_changed_ = true;
|
||||
save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
auto app_config::set_value_by_name(const std::string &name,
|
||||
const std::string &value) -> std::string {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
Loading…
x
Reference in New Issue
Block a user