Complete ring buffer and direct download support #26
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2024-12-22 13:45:32 -06:00
parent 9bead305cf
commit 5df2a5c3c0

View File

@ -415,6 +415,10 @@ auto file_manager::open(
utils::encryption::encrypting_reader::get_data_chunk_size(),
};
auto chunk_timeout = config_.get_enable_download_timeout()
? config_.get_download_timeout_secs()
: 0U;
auto ring_buffer_file_size{
static_cast<std::uint64_t>(config_.get_ring_buffer_file_size()) *
1024UL * 1024UL,
@ -422,9 +426,7 @@ auto file_manager::open(
auto ring_size{ring_buffer_file_size / chunk_size};
const auto get_download_type =
[this, &buffer_directory, &chunk_size, &fsi, &ring_buffer_file_size,
&ring_size](download_type type) -> download_type {
const auto get_download_type = [&](download_type type) -> download_type {
if (fsi.size == 0U) {
return download_type::fallback;
}
@ -462,9 +464,6 @@ auto file_manager::open(
return download_type::direct;
};
auto chunk_timeout = config_.get_enable_download_timeout()
? config_.get_download_timeout_secs()
: 0U;
auto type = get_download_type(config_.get_preferred_download_type());
event_system::instance().raise<download_type_selected>(
fsi.api_path, fsi.source_path, type);