1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

add call to checkInterrupt in a bunch of places

This brings back the old behaviour. We check for interrupts in places
that may iterate over wide directories.
This commit is contained in:
siddhantCodes 2024-06-04 19:35:40 +05:30
parent 1623249745
commit 8f1a26667e
13 changed files with 29 additions and 3 deletions

View file

@ -1407,6 +1407,7 @@ bool LocalStore::verifyStore(bool checkContents, RepairFlag repair)
printInfo("checking link hashes...");
for (auto & link : std::filesystem::directory_iterator{linksDir}) {
checkInterrupt();
auto name = link.path().filename();
printMsg(lvlTalkative, "checking contents of '%s'", name);
PosixSourceAccessor accessor;
@ -1499,6 +1500,7 @@ LocalStore::VerificationResult LocalStore::verifyAllValidPaths(RepairFlag repair
invalid states.
*/
for (auto & i : std::filesystem::directory_iterator{realStoreDir.to_string()}) {
checkInterrupt();
try {
storePathsInStoreDir.insert({i.path().filename().string()});
} catch (BadStorePath &) { }