diff --git a/services/backup/src/Reactors/server/CreateNewBackupReactor.h b/services/backup/src/Reactors/server/CreateNewBackupReactor.h --- a/services/backup/src/Reactors/server/CreateNewBackupReactor.h +++ b/services/backup/src/Reactors/server/CreateNewBackupReactor.h @@ -32,6 +32,7 @@ std::string dataHash; std::string holder; std::string backupID; + uint64_t created; std::shared_ptr putReactor; ServiceBlobClient blobClient; diff --git a/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp b/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp --- a/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp +++ b/services/backup/src/Reactors/server/CreateNewBackupReactor.cpp @@ -10,13 +10,13 @@ std::string CreateNewBackupReactor::generateBackupID(const std::string &userID) { - return generateUUID() + ID_SEPARATOR + - std::to_string(getCurrentTimestamp()); + return generateUUID() + ID_SEPARATOR + std::to_string(this->created); } std::unique_ptr CreateNewBackupReactor::handleRequest( backup::CreateNewBackupRequest request, backup::CreateNewBackupResponse *response) { + this->created = getCurrentTimestamp(); // we make sure that the blob client's state is flushed to the main memory // as there may be multiple threads from the pool taking over here const std::lock_guard lock(this->reactorStateMutex); @@ -93,7 +93,7 @@ database::BackupItem backupItem( this->userID, this->backupID, - getCurrentTimestamp(), + this->created, generateRandomString(), this->holder, {});