Page MenuHomePhabricator

D4089.diff
No OneTemporary

D4089.diff

diff --git a/services/backup/src/Reactors/server/AddAttachmentReactor.cpp b/services/backup/src/Reactors/server/AddAttachmentReactor.cpp
--- a/services/backup/src/Reactors/server/AddAttachmentReactor.cpp
+++ b/services/backup/src/Reactors/server/AddAttachmentReactor.cpp
@@ -41,7 +41,32 @@
}
void AddAttachmentReactor::terminateCallback() {
+ const std::lock_guard<std::mutex> lock(this->reactorStateMutex);
+
+ if (this->parentType == ParentType::BACKUP) {
+ std::shared_ptr<database::BackupItem> backupItem =
+ database::DatabaseManager::getInstance().findBackupItem(
+ this->userID, this->backupID);
+
+ for (const std::string &holder : this->holders) {
+ backupItem->appendAttachmentHolder(holder);
+ }
+ database::DatabaseManager::getInstance().putBackupItem(*backupItem);
+ return;
+ }
+ if (this->parentType == ParentType::LOG) {
+ std::shared_ptr<database::LogItem> logItem =
+ database::DatabaseManager::getInstance().findLogItem(
+ this->backupID, this->logID);
+ for (const std::string &holder : this->holders) {
+ logItem->appendAttachmentHolder(holder);
+ }
+ database::DatabaseManager::getInstance().putLogItem(*logItem);
+ return;
+ }
+ throw std::runtime_error("unhandled parent type");
}
+
} // namespace reactor
} // namespace network
} // namespace comm

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 7:03 PM (7 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2718103
Default Alt Text
D4089.diff (1 KB)

Event Timeline