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