This commit is contained in:
@ -67,6 +67,8 @@ private:
|
|||||||
private:
|
private:
|
||||||
void background_reader_thread();
|
void background_reader_thread();
|
||||||
|
|
||||||
|
[[nodiscard]] auto check_allocation() -> api_error;
|
||||||
|
|
||||||
auto download_chunk(std::size_t chunk, bool skip_active) -> api_error;
|
auto download_chunk(std::size_t chunk, bool skip_active) -> api_error;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -87,15 +87,19 @@ ring_buffer_open_file::~ring_buffer_open_file() {
|
|||||||
|
|
||||||
close();
|
close();
|
||||||
|
|
||||||
nf_->close();
|
if (nf_) {
|
||||||
if (not utils::file::file(source_path_).remove()) {
|
nf_->close();
|
||||||
utils::error::raise_api_path_error(
|
if (not utils::file::file(source_path_).remove()) {
|
||||||
function_name, fsi_.api_path, source_path_,
|
utils::error::raise_api_path_error(
|
||||||
utils::get_last_error_code(), "failed to delete file");
|
function_name, fsi_.api_path, source_path_,
|
||||||
|
utils::get_last_error_code(), "failed to delete file");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reader_thread_->join();
|
if (reader_thread_) {
|
||||||
reader_thread_.reset();
|
reader_thread_->join();
|
||||||
|
reader_thread_.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ring_buffer_open_file::background_reader_thread() {
|
void ring_buffer_open_file::background_reader_thread() {
|
||||||
@ -148,6 +152,10 @@ auto ring_buffer_open_file::can_handle_file(std::uint64_t file_size,
|
|||||||
return file_size >= (static_cast<std::uint64_t>(ring_size) * chunk_size);
|
return file_size >= (static_cast<std::uint64_t>(ring_size) * chunk_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto ring_buffer_open_file::check_allocation() -> api_error {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
auto ring_buffer_open_file::close() -> bool {
|
auto ring_buffer_open_file::close() -> bool {
|
||||||
stop_requested_ = true;
|
stop_requested_ = true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user