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-19 00:19:28 -06:00
parent 7360b72c7b
commit 37854b693b

View File

@ -107,7 +107,7 @@ void file_manager::close(std::uint64_t handle) {
} }
void file_manager::close_all(const std::string &api_path) { void file_manager::close_all(const std::string &api_path) {
recur_mutex_lock file_lock(open_file_mtx_); unique_recur_mutex_lock file_lock(open_file_mtx_);
std::vector<std::uint64_t> handles; std::vector<std::uint64_t> handles;
auto iter = open_file_lookup_.find(api_path); auto iter = open_file_lookup_.find(api_path);
if (iter != open_file_lookup_.end()) { if (iter != open_file_lookup_.end()) {
@ -119,7 +119,9 @@ void file_manager::close_all(const std::string &api_path) {
open_handle_lookup_.erase(handle); open_handle_lookup_.erase(handle);
} }
auto closeable_file = open_file_lookup_.at(api_path);
open_file_lookup_.erase(api_path); open_file_lookup_.erase(api_path);
file_lock.unlock();
} }
void file_manager::close_timed_out_files() { void file_manager::close_timed_out_files() {