aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cas.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-04-30 10:11:25 +0200
committerGitHub Enterprise <[email protected]>2024-04-30 10:11:25 +0200
commitc7a0ddf9f26fdd647574e4031a66362234298e7a (patch)
tree5e3eba1856dc160ca0beb2bc5edaf1ea490a0a6f /src/zenstore/cas.cpp
parentmiscellaneous minor bugfixes (#66) (diff)
downloadzen-c7a0ddf9f26fdd647574e4031a66362234298e7a.tar.xz
zen-c7a0ddf9f26fdd647574e4031a66362234298e7a.zip
fix get project files loop (#68)
- Bugfix: Remove extra loop causing GetProjectFiles for project store to find all chunks once for each chunk found - Bugfix: Don't capture ChunkIndex variable in CasImpl::IterateChunks by reference as it causes crash - Improvement: Make FileCasStrategy::IterateChunks (optionally) multithreaded (improves GetProjectFiles performance)
Diffstat (limited to 'src/zenstore/cas.cpp')
-rw-r--r--src/zenstore/cas.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index 45d7dd277..67790e2c6 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -430,11 +430,14 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
{
return false;
}
- if (!m_LargeStrategy.IterateChunks(DecompressedIds, [&](size_t Index, const IoBuffer& Payload) {
- IoBuffer Chunk(Payload);
- Chunk.SetContentType(ZenContentType::kCompressedBinary);
- return AsyncCallback(Index, Payload);
- }))
+ if (!m_LargeStrategy.IterateChunks(
+ DecompressedIds,
+ [&](size_t Index, const IoBuffer& Payload) {
+ IoBuffer Chunk(Payload);
+ Chunk.SetContentType(ZenContentType::kCompressedBinary);
+ return AsyncCallback(Index, Payload);
+ },
+ OptionalWorkerPool))
{
return false;
}