aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/chunkedcontent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenutil/chunkedcontent.cpp')
-rw-r--r--src/zenutil/chunkedcontent.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/zenutil/chunkedcontent.cpp b/src/zenutil/chunkedcontent.cpp
index a41b71972..6dc2a20d8 100644
--- a/src/zenutil/chunkedcontent.cpp
+++ b/src/zenutil/chunkedcontent.cpp
@@ -92,7 +92,8 @@ namespace {
tsl::robin_map<IoHash, uint32_t, IoHash::Hasher>& RawHashToSequenceRawHashIndex,
RwLock& Lock,
const std::filesystem::path& FolderPath,
- uint32_t PathIndex)
+ uint32_t PathIndex,
+ std::atomic<bool>& AbortFlag)
{
const uint64_t RawSize = OutChunkedContent.RawSizes[PathIndex];
const std::filesystem::path& Path = OutChunkedContent.Paths[PathIndex];
@@ -105,7 +106,7 @@ namespace {
{
ChunkedInfoWithSource Chunked;
const bool DidChunking =
- InChunkingController.ProcessFile((FolderPath / Path).make_preferred(), RawSize, Chunked, Stats.BytesHashed);
+ InChunkingController.ProcessFile((FolderPath / Path).make_preferred(), RawSize, Chunked, Stats.BytesHashed, AbortFlag);
if (DidChunking)
{
Lock.WithExclusiveLock([&]() {
@@ -753,15 +754,13 @@ ChunkFolderContent(ChunkingStatistics& Stats,
RawHashToSequenceRawHashIndex,
Lock,
RootPath,
- PathIndex);
+ PathIndex,
+ AbortFlag);
Lock.WithExclusiveLock([&]() { Result.RawHashes[PathIndex] = RawHash; });
Stats.FilesProcessed++;
}
},
- [&, PathIndex](const std::exception& Ex, std::atomic<bool>& AbortFlag) {
- ZEN_CONSOLE("Failed scanning file {}. Reason: {}", Result.Paths[PathIndex], Ex.what());
- AbortFlag = true;
- });
+ Work.DefaultErrorFunction());
}
Work.Wait(UpdateInteralMS, [&](bool IsAborted, std::ptrdiff_t PendingWork) {