diff options
| author | Dan Engelbrecht <[email protected]> | 2023-09-05 18:53:44 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-06 00:53:44 +0200 |
| commit | 832a1b464633ec7a31a8aad386520e1990d0b6cb (patch) | |
| tree | a07ba97f28fbe90e5aac8ea5d086f687e7aa38bd /src/zenserver/projectstore/projectstore.cpp | |
| parent | retry file create (#383) (diff) | |
| download | zen-832a1b464633ec7a31a8aad386520e1990d0b6cb.tar.xz zen-832a1b464633ec7a31a8aad386520e1990d0b6cb.zip | |
stream oplog attachments from jupiter (#384)
* stream large downloads from jupiter to temporary file
* rework DeleteOnClose - top level marks file for delete and if lower level parts wants to keep it it clears that flag
* changelog
* log number of attachments to download
* add delay on jupiter request failure when retrying
* make sure we upload all attachments even if Needs are empty when ForceUpload is true
release TempAttachment as soon as it is used
* sort attachments so we get predictable blocks for the same oplog
Diffstat (limited to 'src/zenserver/projectstore/projectstore.cpp')
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index e42afdb67..7754f61cd 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -72,10 +72,11 @@ namespace { } while (true); } - std::pair<std::unique_ptr<RemoteProjectStore>, std::string> CreateRemoteStore(CbObjectView Params, - AuthMgr& AuthManager, - size_t MaxBlockSize, - size_t MaxChunkEmbedSize) + std::pair<std::unique_ptr<RemoteProjectStore>, std::string> CreateRemoteStore(CbObjectView Params, + AuthMgr& AuthManager, + size_t MaxBlockSize, + size_t MaxChunkEmbedSize, + const std::filesystem::path& TempFilePath) { using namespace std::literals; @@ -162,7 +163,7 @@ namespace { ForceDisableBlocks, ForceDisableTempBlocks, AssumeHttp2}; - RemoteStore = CreateJupiterRemoteStore(Options); + RemoteStore = CreateJupiterRemoteStore(Options, TempFilePath); } if (CbObjectView Zen = Params["zen"sv].AsObjectView(); Zen) @@ -2700,7 +2701,7 @@ ProjectStore::Export(ProjectStore::Project& Project, ProjectStore::Oplog& Oplog, bool EmbedLooseFile = Params["embedloosefiles"sv].AsBool(false); std::pair<std::unique_ptr<RemoteProjectStore>, std::string> RemoteStoreResult = - CreateRemoteStore(Params, AuthManager, MaxBlockSize, MaxChunkEmbedSize); + CreateRemoteStore(Params, AuthManager, MaxBlockSize, MaxChunkEmbedSize, Oplog.TempPath()); if (RemoteStoreResult.first == nullptr) { @@ -2742,7 +2743,7 @@ ProjectStore::Import(ProjectStore::Project& Project, ProjectStore::Oplog& Oplog, bool Force = Params["force"sv].AsBool(false); std::pair<std::unique_ptr<RemoteProjectStore>, std::string> RemoteStoreResult = - CreateRemoteStore(Params, AuthManager, MaxBlockSize, MaxChunkEmbedSize); + CreateRemoteStore(Params, AuthManager, MaxBlockSize, MaxChunkEmbedSize, Oplog.TempPath()); if (RemoteStoreResult.first == nullptr) { |