This commit is contained in:
@ -137,25 +137,19 @@ auto file_manager::create(const std::string &api_path, api_meta_map &meta,
|
||||
|
||||
auto file_manager::evict_file(const std::string &api_path) -> bool {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
fmt::println("try evict|{}", api_path);
|
||||
|
||||
if (provider_.is_read_only()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
unique_recur_mutex_lock open_lock(open_file_mtx_);
|
||||
fmt::println("try evict locked|{}", api_path);
|
||||
if (is_processing(api_path)) {
|
||||
fmt::println("proccessing|{}", api_path);
|
||||
return false;
|
||||
}
|
||||
fmt::println("not proccessing|{}", api_path);
|
||||
|
||||
if (get_open_file_count(api_path) != 0U) {
|
||||
fmt::println("open count|{}", api_path);
|
||||
return false;
|
||||
}
|
||||
fmt::println("not open|{}", api_path);
|
||||
|
||||
std::string pinned;
|
||||
auto res = provider_.get_item_meta(api_path, META_PINNED, pinned);
|
||||
@ -359,20 +353,17 @@ auto file_manager::is_processing(const std::string &api_path) const -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
fmt::println("ul lock|{}", api_path);
|
||||
unique_mutex_lock upload_lock(upload_mtx_);
|
||||
if (upload_lookup_.find(api_path) != upload_lookup_.end()) {
|
||||
return true;
|
||||
}
|
||||
upload_lock.unlock();
|
||||
fmt::println("ul unlocked|{}", api_path);
|
||||
|
||||
auto upload = mgr_db_->get_upload(api_path);
|
||||
if (upload.has_value()) {
|
||||
return true;
|
||||
};
|
||||
|
||||
fmt::println("of lock|{}", api_path);
|
||||
unique_recur_mutex_lock open_lock(open_file_mtx_);
|
||||
auto file_iter = open_file_lookup_.find(api_path);
|
||||
if (file_iter == open_file_lookup_.end()) {
|
||||
@ -380,7 +371,6 @@ auto file_manager::is_processing(const std::string &api_path) const -> bool {
|
||||
}
|
||||
|
||||
auto file = file_iter->second;
|
||||
fmt::println("of unlocked|{}", api_path);
|
||||
open_lock.unlock();
|
||||
|
||||
return file->is_modified() || not file->is_complete();
|
||||
|
Reference in New Issue
Block a user