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

This commit is contained in:
Scott E. Graves 2023-11-14 20:28:47 -06:00
parent d808b2dd19
commit 7203fefd33
2 changed files with 5 additions and 2 deletions

View File

@ -137,7 +137,7 @@ void file_manager::close_timed_out_files() {
for (const auto &api_path : closeable_list) {
auto closeable_file = open_file_lookup_.at(api_path);
open_file_lookup_.erase(api_path);
open_files.emplace_back(closeable_file);
open_files.push_back(std::move(closeable_file));
}
closeable_list.clear();
file_lock.unlock();
@ -952,7 +952,7 @@ void file_manager::upload_handler() {
} break;
}
} else {
iterator.release();
iterator.reset();
upload_notify_.wait(upload_lock);
}
} else {

View File

@ -255,12 +255,14 @@ auto file_manager::open_file::native_operation(
return api_error::invalid_operation;
}
std::cout << "native_operation1" << std::endl;
unique_recur_mutex_lock file_lock(file_mtx_);
if (stop_requested_) {
return api_error::download_stopped;
}
file_lock.unlock();
std::cout << "native_operation2" << std::endl;
const auto is_empty_file = new_file_size == 0U;
const auto last_chunk =
is_empty_file ? std::size_t(0U)
@ -270,6 +272,7 @@ auto file_manager::open_file::native_operation(
file_lock.lock();
if (not is_empty_file && (last_chunk < read_state_.size())) {
std::cout << "native_operation3" << std::endl;
file_lock.unlock();
update_background_reader(0U);