mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 15:32:43 +01:00
Add an activity for binary cache queries
This commit is contained in:
parent
c2154d4c84
commit
fd73c1e20a
4 changed files with 19 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ struct CurlDownloader : public Downloader
|
|||
DownloadItem(CurlDownloader & downloader, const DownloadRequest & request)
|
||||
: downloader(downloader)
|
||||
, request(request)
|
||||
, act(*logger, lvlTalkative, actDownload, fmt("downloading '%s'", request.uri), {}, request.parentAct)
|
||||
, act(*logger, lvlTalkative, actDownload, fmt("downloading '%s'", request.uri), {request.uri}, request.parentAct)
|
||||
{
|
||||
if (!request.expectedETag.empty())
|
||||
requestHeaders = curl_slist_append(requestHeaders, ("If-None-Match: " + request.expectedETag).c_str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue