diff --git a/repertory/librepertory/src/db/impl/rdb_file_mgr_db.cpp b/repertory/librepertory/src/db/impl/rdb_file_mgr_db.cpp index 99885a47..2bf76fca 100644 --- a/repertory/librepertory/src/db/impl/rdb_file_mgr_db.cpp +++ b/repertory/librepertory/src/db/impl/rdb_file_mgr_db.cpp @@ -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, - rocksdb::Transaction *txn) - -> rocksdb::Status { +auto rdb_file_mgr_db::remove_resume( + const std::string &api_path, rocksdb::Transaction *txn) -> rocksdb::Status { 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 { REPERTORY_USES_FUNCTION_NAME(); + bool not_found{false}; std::string value; auto res = perform_action( - function_name, [this, &from_api_path, &value]() -> rocksdb::Status { - return db_->Get(rocksdb::ReadOptions{}, from_api_path, &value); + function_name, + [this, &from_api_path, ¬_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) { return false; } if (value.empty()) { - return false; + return true; } auto data = json::parse(value);