1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

Progress indicator: Show number of active items

This commit is contained in:
Eelco Dolstra 2017-08-14 22:42:17 +02:00
parent 0e0dcf2c7e
commit bf1f123b09
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 39 additions and 28 deletions

View file

@ -625,9 +625,10 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
std::atomic<size_t> nrDone{0};
std::atomic<uint64_t> bytesExpected{0};
std::atomic<uint64_t> nrRunning{0};
auto showProgress = [&]() {
act.progress(nrDone, missing.size());
act.progress(nrDone, missing.size(), nrRunning);
};
ThreadPool pool;
@ -655,6 +656,8 @@ void copyPaths(ref<Store> srcStore, ref<Store> dstStore, const PathSet & storePa
if (!dstStore->isValidPath(storePath)) {
printInfo("copying '%s'...", storePath);
MaintainCount<decltype(nrRunning)> mc(nrRunning);
showProgress();
copyStorePath(srcStore, dstStore, storePath, repair, checkSigs);
}