1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 20:51:00 +01:00

* Commit more often to prevent out-of-memory errors.

This commit is contained in:
Eelco Dolstra 2005-02-09 14:37:24 +00:00
parent 98df735b51
commit 3a99616968
3 changed files with 22 additions and 4 deletions

View file

@ -824,6 +824,7 @@ static void upgradeStore()
PathSet validPaths(validPaths2.begin(), validPaths2.end());
cerr << "hashing paths...";
int n = 0;
for (PathSet::iterator i = validPaths.begin(); i != validPaths.end(); ++i) {
checkInterrupt();
string s;
@ -832,10 +833,18 @@ static void upgradeStore()
Hash hash = hashPath(htSHA256, *i);
setHash(txn, *i, hash);
cerr << ".";
if (++n % 1000 == 0) {
txn.commit();
txn.begin(nixDB);
}
}
}
cerr << "\n";
txn.commit();
txn.begin(nixDB);
cerr << "processing closures...";
for (PathSet::iterator i = validPaths.begin(); i != validPaths.end(); ++i) {
checkInterrupt();