about summary refs log tree commit diff
path: root/src/libstore/binary-cache-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-08-31T13·25+0200
committerEelco Dolstra <edolstra@gmail.com>2017-08-31T13·25+0200
commitfd73c1e20a7aaefcb69db3e6b2f081e1a5e20406 (patch)
treed3134fc81e2895e3e2837df6eb457efab28e3fea /src/libstore/binary-cache-store.cc
parentc2154d4c8422ddc1c201d503bb52edff854af2ad (diff)
Add an activity for binary cache queries
Diffstat (limited to 'src/libstore/binary-cache-store.cc')
-rw-r--r--src/libstore/binary-cache-store.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index 403b468728..556fa3d593 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -313,6 +313,11 @@ void BinaryCacheStore::queryPathInfoUncached(const Path & storePath,
         std::function<void(std::shared_ptr<ValidPathInfo>)> success,
         std::function<void(std::exception_ptr exc)> failure)
 {
+    auto uri = getUri();
+    auto act = std::make_shared<Activity>(*logger, lvlTalkative, actQueryPathInfo,
+        fmt("querying info about '%s' on '%s'", storePath, uri), Logger::Fields{storePath, uri});
+    PushActivity pact(act->id);
+
     auto narInfoFile = narInfoFileFor(storePath);
 
     getFile(narInfoFile,
@@ -323,6 +328,8 @@ void BinaryCacheStore::queryPathInfoUncached(const Path & storePath,
 
             callSuccess(success, failure, (std::shared_ptr<ValidPathInfo>)
                 std::make_shared<NarInfo>(*this, *data, narInfoFile));
+
+            (void) act; // force Activity into this lambda to ensure it stays alive
         },
         failure);
 }