diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 394834ad6..82961e547 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -87,6 +87,7 @@ struct curlFileTransfer : public FileTransfer TransferItem(curlFileTransfer & fileTransfer, const FileTransferRequest & request, + ActivityId parentAct, std::invocable auto callback, std::function dataCallback, std::optional uploadData @@ -95,7 +96,7 @@ struct curlFileTransfer : public FileTransfer , request(request) , act(*logger, lvlTalkative, actFileTransfer, fmt(uploadData ? "uploading '%s'" : "downloading '%s'", request.uri), - {request.uri}, request.parentAct) + {request.uri}, parentAct) , uploadData(std::move(uploadData)) , callback([cb{std::move(callback)}] (std::exception_ptr ex, FileTransferResult r) { cb(ex); @@ -714,11 +715,14 @@ struct curlFileTransfer : public FileTransfer }); } - return enqueueItem( - std::make_shared( - *this, request, std::move(callback), std::move(dataCallback), std::move(data) - ) - ) + return enqueueItem(std::make_shared( + *this, + request, + getCurActivity(), + std::move(callback), + std::move(dataCallback), + std::move(data) + )) ->callback.get_future(); } diff --git a/src/libstore/filetransfer.hh b/src/libstore/filetransfer.hh index 3d277c761..38a9243ad 100644 --- a/src/libstore/filetransfer.hh +++ b/src/libstore/filetransfer.hh @@ -61,10 +61,9 @@ struct FileTransferRequest bool head = false; size_t tries = fileTransferSettings.tries; unsigned int baseRetryTimeMs = 250; - ActivityId parentAct; FileTransferRequest(std::string_view uri) - : uri(uri), parentAct(getCurActivity()) { } + : uri(uri) { } }; struct FileTransferResult