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

This commit is contained in:
Scott E. Graves 2024-12-22 08:16:36 -06:00
parent 2952cc8373
commit fd18ad9102

View File

@ -35,14 +35,16 @@ void open_file_base::download::notify(const api_error &err) {
}
auto open_file_base::download::wait() -> api_error {
if (not complete_) {
unique_mutex_lock lock(mtx_);
if (not complete_) {
notify_.wait(lock);
}
notify_.notify_all();
if (complete_) {
return error_;
}
unique_mutex_lock lock(mtx_);
if (not complete_) {
notify_.wait(lock);
}
notify_.notify_all();
return error_;
}
@ -195,7 +197,7 @@ auto open_file_base::get_filesystem_item() const -> filesystem_item {
auto open_file_base::get_handles() const -> std::vector<std::uint64_t> {
recur_mutex_lock file_lock(file_mtx_);
std::vector<std::uint64_t> ret;
for (auto &&item : open_data_) {
for (const auto &item : open_data_) {
ret.emplace_back(item.first);
}
@ -261,7 +263,7 @@ void open_file_base::remove_all() {
auto open_data = open_data_;
open_data_.clear();
for (auto &&data : open_data) {
for (const auto &data : open_data) {
event_system::instance().raise<filesystem_item_handle_closed>(
fsi_.api_path, data.first, fsi_.source_path, fsi_.directory, modified_);
}