1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

nix store copy-sigs: Use http-connections setting to control parallelism

Previously it used the `ThreadPool` default,
i.e. `std:🧵:hardware_concurrency()`. But copying signatures is
not primarily CPU-bound so it makes more sense to use the
`http-connections` setting (since we're typically copying from/to a
binary cache).
This commit is contained in:
Eelco Dolstra 2025-06-02 11:41:02 +02:00
parent 6417863ce9
commit 6b6ceddf72

View file

@ -3,6 +3,7 @@
#include "nix/main/shared.hh" #include "nix/main/shared.hh"
#include "nix/store/store-open.hh" #include "nix/store/store-open.hh"
#include "nix/util/thread-pool.hh" #include "nix/util/thread-pool.hh"
#include "nix/store/filetransfer.hh"
#include <atomic> #include <atomic>
@ -38,7 +39,7 @@ struct CmdCopySigs : StorePathsCommand
for (auto & s : substituterUris) for (auto & s : substituterUris)
substituters.push_back(openStore(s)); substituters.push_back(openStore(s));
ThreadPool pool; ThreadPool pool{fileTransferSettings.httpConnections};
std::atomic<size_t> added{0}; std::atomic<size_t> added{0};