[bug] Low frequency check is set to '0' instead of 1 hour by default #35

[bug] Max cache size bytes is set to '0' by default #36
This commit is contained in:
Scott E. Graves 2025-02-14 07:50:29 -06:00
parent c70b896521
commit b02d524d10
3 changed files with 9 additions and 4 deletions

View File

@ -7,6 +7,8 @@
* ~~\#12 [Unit Test] Complete all providers unit tests~~
* ~~\#21 [Unit Test] Complete WinFSP unit tests~~
* ~~\#22 [Unit Test] Complete FUSE unit tests~~
* \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default
* \#36 [bug] Max cache size bytes is set to '0' by default
### Changes from v2.0.3-rc

View File

@ -27,9 +27,9 @@ constexpr const auto default_api_auth_size{48U};
constexpr const auto default_download_timeout_ces{30U};
constexpr const auto default_eviction_delay_mins{1U};
constexpr const auto default_high_freq_interval_secs{30U};
constexpr const auto default_low_freq_interval_secs{60U * 60U};
constexpr const auto default_low_freq_interval_secs{std::uint16_t(60U * 60U)};
constexpr const auto default_max_cache_size_bytes{
std::uint64_t(20UL * 1024UL * 1024UL * 1024UL),
std::uint64_t(20ULL * 1024ULL * 1024ULL * 1024ULL),
};
constexpr const auto default_max_upload_count{5U};
constexpr const auto default_med_freq_interval_secs{2U * 60U};
@ -43,7 +43,7 @@ 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 max_s3_object_name_length{1024U};
constexpr const auto min_cache_size_bytes{
std::uint64_t(100UL * 1024UL * 1024UL),
std::uint64_t(100ULL * 1024ULL * 1024ULL),
};
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)};
constexpr const auto min_online_check_retry_secs{std::uint16_t(15U)};

View File

@ -1069,13 +1069,16 @@ auto app_config::load() -> bool {
std::uint64_t version{};
get_value(json_document, JSON_VERSION, version, found);
// Handle configuration defaults for new config versions
if (version != REPERTORY_CONFIG_VERSION) {
version_ = REPERTORY_CONFIG_VERSION;
if (version_ == 1U) {
if (low_freq_interval_secs_ == 0UL) {
set_value(low_freq_interval_secs_, default_low_freq_interval_secs);
}
if (max_cache_size_bytes_ == 0UL) {
set_value(max_cache_size_bytes_, default_max_cache_size_bytes);
}
}
found = false;
}