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

This commit is contained in:
Scott E. Graves 2024-12-22 07:30:08 -06:00
parent ca7257d7f7
commit fc9624e996

View File

@ -241,9 +241,8 @@ auto rdb_file_mgr_db::remove_resume(const std::string &api_path) -> bool {
}); });
} }
auto rdb_file_mgr_db::remove_resume(const std::string &api_path, auto rdb_file_mgr_db::remove_resume(
rocksdb::Transaction *txn) const std::string &api_path, rocksdb::Transaction *txn) -> rocksdb::Status {
-> rocksdb::Status {
return txn->Delete(resume_family_, api_path); return txn->Delete(resume_family_, api_path);
} }
@ -284,17 +283,25 @@ auto rdb_file_mgr_db::rename_resume(const std::string &from_api_path,
const std::string &to_api_path) -> bool { const std::string &to_api_path) -> bool {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
bool not_found{false};
std::string value; std::string value;
auto res = perform_action( auto res = perform_action(
function_name, [this, &from_api_path, &value]() -> rocksdb::Status { function_name,
return db_->Get(rocksdb::ReadOptions{}, from_api_path, &value); [this, &from_api_path, &not_found, &value]() -> rocksdb::Status {
auto res = db_->Get(rocksdb::ReadOptions{}, from_api_path, &value);
not_found = res.IsNotFound();
return res;
}); });
if (not_found) {
return true;
}
if (not res) { if (not res) {
return false; return false;
} }
if (value.empty()) { if (value.empty()) {
return false; return true;
} }
auto data = json::parse(value); auto data = json::parse(value);