Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3550907
D4089.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4089.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D4089: [services] Backup - Add Attachment Reactor - terminate callback
Attached
Detach File
Event Timeline
Log In to Comment