Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3354255
D3535.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
D3535.diff
View Options
diff --git a/services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h b/services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
--- a/services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
+++ b/services/backup/docker-server/contents/server/src/Reactors/server/CreateNewBackupReactor.h
@@ -1,5 +1,6 @@
#pragma once
+#include "DatabaseManager.h"
#include "ServerBidiReactorBase.h"
#include "ServiceBlobClient.h"
#include "Tools.h"
@@ -30,6 +31,7 @@
std::string userID;
std::string keyEntropy;
std::string dataHash;
+ std::string holder;
std::string backupID;
std::shared_ptr<reactor::BlobPutClientReactor> putReactor;
ServiceBlobClient blobClient;
@@ -84,8 +86,9 @@
// TODO confirm - holder may be a backup id
this->backupID = this->generateBackupID();
+ this->holder = this->backupID;
this->putReactor = std::make_shared<reactor::BlobPutClientReactor>(
- this->backupID, this->dataHash, &this->blobDoneCV);
+ this->holder, this->dataHash, &this->blobDoneCV);
this->blobClient.put(this->putReactor);
return nullptr;
}
@@ -106,6 +109,20 @@
this->putReactor->scheduleSendingDataChunk(std::make_unique<std::string>(""));
std::unique_lock<std::mutex> lock2(this->blobDoneCVMutex);
this->blobDoneCV.wait(lock2);
+ try {
+ // TODO add recovery data
+ // TODO handle attachments holders
+ database::BackupItem backupItem(
+ this->userID,
+ this->backupID,
+ getCurrentTimestamp(),
+ generateRandomString(),
+ this->holder,
+ {});
+ database::DatabaseManager::getInstance().putBackupItem(backupItem);
+ } catch (std::runtime_error &e) {
+ std::cout << "db operations error: " << e.what() << std::endl;
+ }
}
} // namespace reactor
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 12:34 PM (20 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575587
Default Alt Text
D3535.diff (1 KB)
Attached To
Mode
D3535: [services] Backup - Create new backup - Add database operations
Attached
Detach File
Event Timeline
Log In to Comment