mirror of
https://github.com/NixOS/nix
synced 2025-06-28 09:31:16 +02:00
importPaths(): Optionally add NARs to binary cache accessor
This enables an optimisation in hydra-queue-runner, preventing a download of a NAR it just uploaded to the cache when reading files like hydra-build-products.
This commit is contained in:
parent
1042c10fd0
commit
bcc9943cee
10 changed files with 58 additions and 44 deletions
|
@ -732,7 +732,7 @@ static void opImport(Strings opFlags, Strings opArgs)
|
|||
if (!opArgs.empty()) throw UsageError("no arguments expected");
|
||||
|
||||
FdSource source(STDIN_FILENO);
|
||||
Paths paths = store->importPaths(requireSignature, source);
|
||||
Paths paths = store->importPaths(requireSignature, source, 0);
|
||||
|
||||
for (auto & i : paths)
|
||||
cout << format("%1%\n") % i << std::flush;
|
||||
|
@ -935,7 +935,7 @@ static void opServe(Strings opFlags, Strings opArgs)
|
|||
|
||||
case cmdImportPaths: {
|
||||
if (!writeAllowed) throw Error("importing paths is not allowed");
|
||||
store->importPaths(false, in);
|
||||
store->importPaths(false, in, 0);
|
||||
out << 1; // indicate success
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue