Page MenuHomePhabricator

D3999.id12647.diff
No OneTemporary

D3999.id12647.diff

diff --git a/services/backup/src/DatabaseManager.cpp b/services/backup/src/DatabaseManager.cpp
--- a/services/backup/src/DatabaseManager.cpp
+++ b/services/backup/src/DatabaseManager.cpp
@@ -90,6 +90,9 @@
}
void DatabaseManager::removeBackupItem(std::shared_ptr<BackupItem> item) {
+ if (item == nullptr) {
+ return;
+ }
this->innerRemoveItem(*item);
}
@@ -146,6 +149,9 @@
}
void DatabaseManager::removeLogItem(std::shared_ptr<LogItem> item) {
+ if (item == nullptr) {
+ return;
+ }
this->innerRemoveItem(*item);
}
diff --git a/services/blob/src/BlobServiceImpl.cpp b/services/blob/src/BlobServiceImpl.cpp
--- a/services/blob/src/BlobServiceImpl.cpp
+++ b/services/blob/src/BlobServiceImpl.cpp
@@ -79,12 +79,7 @@
// TODO handle cleanup here properly
// for now the object's being removed right away
const std::string blobHash = reverseIndexItem->getBlobHash();
- if (!database::DatabaseManager::getInstance().removeReverseIndexItem(
- holder)) {
- throw std::runtime_error(
- "could not remove an item for holder " + holder +
- "(probably does not exist)");
- }
+ database::DatabaseManager::getInstance().removeReverseIndexItem(holder);
if (database::DatabaseManager::getInstance()
.findReverseIndexItemsByHash(reverseIndexItem->getBlobHash())
.size() == 0) {
diff --git a/services/blob/src/DatabaseManager.h b/services/blob/src/DatabaseManager.h
--- a/services/blob/src/DatabaseManager.h
+++ b/services/blob/src/DatabaseManager.h
@@ -33,7 +33,7 @@
findReverseIndexItemByHolder(const std::string &holder);
std::vector<std::shared_ptr<database::ReverseIndexItem>>
findReverseIndexItemsByHash(const std::string &blobHash);
- bool removeReverseIndexItem(const std::string &holder);
+ void removeReverseIndexItem(const std::string &holder);
};
} // namespace database
diff --git a/services/blob/src/DatabaseManager.cpp b/services/blob/src/DatabaseManager.cpp
--- a/services/blob/src/DatabaseManager.cpp
+++ b/services/blob/src/DatabaseManager.cpp
@@ -107,14 +107,13 @@
return result;
}
-bool DatabaseManager::removeReverseIndexItem(const std::string &holder) {
+void DatabaseManager::removeReverseIndexItem(const std::string &holder) {
std::shared_ptr<database::ReverseIndexItem> item =
findReverseIndexItemByHolder(holder);
if (item == nullptr) {
- return false;
+ return;
}
this->innerRemoveItem(*item);
- return true;
}
} // namespace database

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 4:37 AM (18 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2513612
Default Alt Text
D3999.id12647.diff (2 KB)

Event Timeline