File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -230,18 +230,22 @@ void Store::addMultipleToStore(
230230{
231231 std::atomic<size_t > nrDone{0 };
232232 std::atomic<size_t > nrFailed{0 };
233- std::atomic<uint64_t > bytesExpected{0 };
234233 std::atomic<uint64_t > nrRunning{0 };
235234
236235 using PathWithInfo = std::pair<ValidPathInfo, std::unique_ptr<Source>>;
237236
237+ uint64_t bytesExpected = 0 ;
238+
238239 std::map<StorePath, PathWithInfo *> infosMap;
239240 StorePathSet storePathsToAdd;
240241 for (auto & thingToAdd : pathsToCopy) {
242+ bytesExpected += thingToAdd.first .narSize ;
241243 infosMap.insert_or_assign (thingToAdd.first .path , &thingToAdd);
242244 storePathsToAdd.insert (thingToAdd.first .path );
243245 }
244246
247+ act.setExpected (actCopyPath, bytesExpected);
248+
245249 auto showProgress = [&, nrTotal = pathsToCopy.size ()]() {
246250 act.progress (nrDone, nrTotal, nrRunning, nrFailed);
247251 };
@@ -259,9 +263,6 @@ void Store::addMultipleToStore(
259263 return StorePathSet ();
260264 }
261265
262- bytesExpected += info.narSize ;
263- act.setExpected (actCopyPath, bytesExpected);
264-
265266 return info.references ;
266267 },
267268
You can’t perform that action at this time.
0 commit comments