Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3270622
D3999.id12647.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D3999.id12647.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D3999: [services] consistently return when trying to remove non-existent item
Attached
Detach File
Event Timeline
Log In to Comment