about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-08-14T20·42+0200
committerEelco Dolstra <edolstra@gmail.com>2017-08-16T18·56+0200
commitbf1f123b09ec7402b0565808619e11b5bfe6b16b (patch)
treed0e4c9af039b8bf05244f648907c21274ee37054 /src/libstore/store-api.cc
parent0e0dcf2c7ec054f1b30629e275f53f56039b8257 (diff)
Progress indicator: Show number of active items
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 1e11e54eba7c..5aa3dcfd26a3 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -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);
             }