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

This commit is contained in:
2025-07-20 15:05:57 -05:00
parent 63edb3a1e9
commit 1ea2d1496d

View File

@@ -370,7 +370,7 @@ auto file_manager::is_processing(const std::string &api_path) const -> bool {
} }
unique_mutex_lock upload_lock(upload_mtx_); unique_mutex_lock upload_lock(upload_mtx_);
if (upload_lookup_.find(api_path) != upload_lookup_.end()) { if (upload_lookup_.contains(api_path)) {
return true; return true;
} }
upload_lock.unlock(); upload_lock.unlock();
@@ -695,7 +695,7 @@ void file_manager::remove_upload(const std::string &api_path, bool no_lock) {
"failed to remove active upload"); "failed to remove active upload");
} }
if (upload_lookup_.find(api_path) != upload_lookup_.end()) { if (upload_lookup_.contains(api_path)) {
upload_lookup_.at(api_path)->cancel(); upload_lookup_.at(api_path)->cancel();
upload_lookup_.erase(api_path); upload_lookup_.erase(api_path);
} }
@@ -871,9 +871,12 @@ void file_manager::start() {
stop_requested_ = false; stop_requested_ = false;
polling::instance().set_callback({ polling::instance().set_callback({
"timed_out_close", .name = "timed_out_close",
polling::frequency::second, .freq = polling::frequency::second,
[this](auto && /* stop_requested */) { this->close_timed_out_files(); }, .action =
[this](auto && /* stop_requested */) {
this->close_timed_out_files();
},
}); });
if (provider_.is_read_only()) { if (provider_.is_read_only()) {
@@ -1002,10 +1005,10 @@ void file_manager::store_resume(const i_open_file &file) {
} }
if (mgr_db_->add_resume(i_file_mgr_db::resume_entry{ if (mgr_db_->add_resume(i_file_mgr_db::resume_entry{
file.get_api_path(), .api_path = file.get_api_path(),
file.get_chunk_size(), .chunk_size = file.get_chunk_size(),
file.get_read_state(), .read_state = file.get_read_state(),
file.get_source_path(), .source_path = file.get_source_path(),
})) { })) {
event_system::instance().raise<download_resume_added>( event_system::instance().raise<download_resume_added>(
file.get_api_path(), file.get_source_path(), function_name); file.get_api_path(), file.get_source_path(), function_name);
@@ -1110,8 +1113,8 @@ void file_manager::upload_handler() {
if (mgr_db_->remove_upload(entry->api_path)) { if (mgr_db_->remove_upload(entry->api_path)) {
if (not mgr_db_->add_upload_active( if (not mgr_db_->add_upload_active(
i_file_mgr_db::upload_active_entry{ i_file_mgr_db::upload_active_entry{
entry->api_path, .api_path = entry->api_path,
entry->source_path, .source_path = entry->source_path,
})) { })) {
utils::error::raise_api_path_error( utils::error::raise_api_path_error(
function_name, entry->api_path, entry->source_path, function_name, entry->api_path, entry->source_path,