refactor
This commit is contained in:
parent
d808b2dd19
commit
7203fefd33
@ -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 {
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user