fix truncate
All checks were successful
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good

This commit is contained in:
2023-11-18 19:07:53 -06:00
parent 8555d31ddf
commit dc48b84191
4 changed files with 39 additions and 37 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.push_back(std::move(closeable_file));
open_files.push_back(closeable_file);
}
closeable_list.clear();
file_lock.unlock();
@ -434,8 +434,8 @@ void file_manager::queue_upload(const std::string &api_path,
auto file_manager::remove_file(const std::string &api_path) -> api_error {
recur_mutex_lock open_lock(open_file_mtx_);
auto it = open_file_lookup_.find(api_path);
if (it != open_file_lookup_.end() && it->second->is_modified()) {
auto iter = open_file_lookup_.find(api_path);
if (iter != open_file_lookup_.end() && iter->second->is_modified()) {
return api_error::file_in_use;
}
@ -445,14 +445,13 @@ auto file_manager::remove_file(const std::string &api_path) -> api_error {
return res;
}
remove_upload(api_path);
close_all(api_path);
if ((res = provider_.remove_file(api_path)) != api_error::success) {
return res;
}
remove_upload(api_path);
close_all(api_path);
if (not utils::file::retry_delete_file(fsi.source_path)) {
utils::error::raise_api_path_error(
__FUNCTION__, fsi.api_path, fsi.source_path,

View File

@ -233,6 +233,8 @@ auto file_manager::open_file_base::close() -> bool {
io_thread_.reset();
return true;
}
return false;
}
io_thread_notify_.notify_all();