aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/cas.cpp')
-rw-r--r--src/zenstore/cas.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/zenstore/cas.cpp b/src/zenstore/cas.cpp
index ed017988f..8855c87d8 100644
--- a/src/zenstore/cas.cpp
+++ b/src/zenstore/cas.cpp
@@ -153,7 +153,10 @@ CasImpl::Initialize(const CidStoreConfiguration& InConfig)
}
for (std::future<void>& Result : Work)
{
- Result.get();
+ if (Result.valid())
+ {
+ Result.get();
+ }
}
}
}
@@ -300,12 +303,12 @@ GetCompactCasResults(CasContainerStrategy& Strategy,
};
static void
-GetFileCasResults(FileCasStrategy& Strategy,
- CasStore::InsertMode Mode,
- std::span<IoBuffer> Data,
- std::span<IoHash> ChunkHashes,
- std::span<size_t> Indexes,
- std::vector<CasStore::InsertResult> Results)
+GetFileCasResults(FileCasStrategy& Strategy,
+ CasStore::InsertMode Mode,
+ std::span<IoBuffer> Data,
+ std::span<IoHash> ChunkHashes,
+ std::span<size_t> Indexes,
+ std::vector<CasStore::InsertResult>& Results)
{
for (size_t Index : Indexes)
{
@@ -426,7 +429,7 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
[&](size_t Index, const IoBuffer& Payload) {
IoBuffer Chunk(Payload);
Chunk.SetContentType(ZenContentType::kCompressedBinary);
- return AsyncCallback(Index, Payload);
+ return AsyncCallback(Index, Chunk);
},
OptionalWorkerPool,
LargeSizeLimit == 0 ? m_Config.HugeValueThreshold : Min(LargeSizeLimit, m_Config.HugeValueThreshold)))
@@ -439,7 +442,7 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
[&](size_t Index, const IoBuffer& Payload) {
IoBuffer Chunk(Payload);
Chunk.SetContentType(ZenContentType::kCompressedBinary);
- return AsyncCallback(Index, Payload);
+ return AsyncCallback(Index, Chunk);
},
OptionalWorkerPool,
LargeSizeLimit == 0 ? m_Config.TinyValueThreshold : Min(LargeSizeLimit, m_Config.TinyValueThreshold)))
@@ -452,7 +455,7 @@ CasImpl::IterateChunks(std::span<IoHash> DecompressedIds,
[&](size_t Index, const IoBuffer& Payload) {
IoBuffer Chunk(Payload);
Chunk.SetContentType(ZenContentType::kCompressedBinary);
- return AsyncCallback(Index, Payload);
+ return AsyncCallback(Index, Chunk);
},
OptionalWorkerPool))
{
@@ -512,6 +515,8 @@ CreateCasStore(GcManager& Gc)
#if ZEN_WITH_TESTS
+TEST_SUITE_BEGIN("store.cas");
+
TEST_CASE("CasStore")
{
ScopedTemporaryDirectory TempDir;
@@ -553,6 +558,8 @@ TEST_CASE("CasStore")
CHECK(Lookup2);
}
+TEST_SUITE_END();
+
void
CAS_forcelink()
{