refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2024-12-25 12:05:16 -06:00
parent c4707c2cf7
commit 1d939e69fd

View File

@ -547,9 +547,8 @@ auto open_file::read(std::size_t read_size, std::uint64_t read_offset,
return set_api_error(api_error::invalid_operation);
}
auto res = check_allocation();
if (res != api_error::success) {
return res;
if (stop_requested_) {
return set_api_error(api_error::download_stopped);
}
read_size =
@ -558,6 +557,11 @@ auto open_file::read(std::size_t read_size, std::uint64_t read_offset,
return api_error::success;
}
auto res = check_allocation();
if (res != api_error::success) {
return res;
}
const auto read_from_source = [this, &data, &read_offset,
&read_size]() -> api_error {
return do_io([this, &data, &read_offset, &read_size]() -> api_error {