diff options
| author | Dan Engelbrecht <[email protected]> | 2023-08-24 12:38:51 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-08-24 12:38:51 +0200 |
| commit | 26134d49cc2b5174cbee1ce0b8c1b023f5e451eb (patch) | |
| tree | ec8c80b0f95c8fbe6d23aaebc517abc0d01a52fa /src/zenserver/projectstore/projectstore.cpp | |
| parent | crash in process cache (#375) (diff) | |
| download | zen-26134d49cc2b5174cbee1ce0b8c1b023f5e451eb.tar.xz zen-26134d49cc2b5174cbee1ce0b8c1b023f5e451eb.zip | |
Add `--embedloosefiles` option to `oplog-export` (#376)
* Add `--embedloosefiles` option to `oplog-export` which adds loose files to the export, removing need to call `oplog-snapshot`
* Retain `ServerPath` in oplog when performing `oplog-snapshot`. This is a short-term fix for current incompatability with the UE cooker.
Diffstat (limited to 'src/zenserver/projectstore/projectstore.cpp')
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index 06d5221c4..c37b8c8d4 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -2322,13 +2322,15 @@ ProjectStore::ReadOplog(const std::string_view ProjectId, RemoteProjectStore::LoadContainerResult ContainerResult = BuildContainer( ChunkStore, + *Project.Get(), *Oplog, MaxBlockSize, MaxChunkEmbedSize, false, [](CompressedBuffer&&, const IoHash) {}, [](const IoHash&) {}, - [](const std::unordered_set<IoHash, IoHash::Hasher>) {}); + [](const std::unordered_set<IoHash, IoHash::Hasher>) {}, + nullptr); OutResponse = std::move(ContainerResult.ContainerObject); return ConvertResult(ContainerResult); @@ -2569,7 +2571,7 @@ ProjectStore::Rpc(HttpServerRequest& HttpReq, Oid ChunkId = View["id"sv].AsObjectId(); IoBuffer FileIoBuffer = DataFile.ReadAll(); - CompressedBuffer Compressed = CompressedBuffer::Compress(SharedBuffer(FileIoBuffer)); + CompressedBuffer Compressed = CompressedBuffer::Compress(SharedBuffer(std::move(FileIoBuffer))); const IoHash RawHash = Compressed.DecodeRawHash(); const uint64_t RawSize = Compressed.DecodeRawSize(); IoBuffer CompressedBuffer = Compressed.GetCompressed().Flatten().AsIoBuffer(); @@ -2592,12 +2594,6 @@ ProjectStore::Rpc(HttpServerRequest& HttpReq, // omit this field as we will write it explicitly ourselves return true; } - else if (Field.GetName() == "serverpath"sv) - { - // omit this field as it's not relevant if there is a hash - return true; - } - return false; }); Writer.AddBinaryAttachment("data"sv, RawHash); @@ -2688,6 +2684,7 @@ ProjectStore::Export(ProjectStore::Project& Project, ProjectStore::Oplog& Oplog, size_t MaxBlockSize = Params["maxblocksize"sv].AsUInt64(128u * 1024u * 1024u); size_t MaxChunkEmbedSize = Params["maxchunkembedsize"sv].AsUInt64(1024u * 1024u); bool Force = Params["force"sv].AsBool(false); + bool EmbedLooseFile = Params["embedloosefiles"sv].AsBool(false); std::pair<std::unique_ptr<RemoteProjectStore>, std::string> RemoteStoreResult = CreateRemoteStore(Params, AuthManager, MaxBlockSize, MaxChunkEmbedSize); @@ -2708,9 +2705,11 @@ ProjectStore::Export(ProjectStore::Project& Project, ProjectStore::Oplog& Oplog, RemoteProjectStore::Result Result = SaveOplog(m_CidStore, *RemoteStore, + Project, Oplog, MaxBlockSize, MaxChunkEmbedSize, + EmbedLooseFile, StoreInfo.CreateBlocks, StoreInfo.UseTempBlockFiles, Force); |