mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +02:00
* Make the garbage collector more resilient to certain consistency
errors: in-use paths now cause a warning, not a fatal error.
This commit is contained in:
parent
8659edc098
commit
8f67b35886
3 changed files with 10 additions and 4 deletions
|
@ -599,9 +599,13 @@ void LocalStore::collectGarbage(GCAction action, const PathSet & pathsToDelete,
|
|||
printMsg(lvlInfo, format("deleting `%1%'") % *i);
|
||||
|
||||
/* Okay, it's safe to delete. */
|
||||
unsigned long long freed;
|
||||
deleteFromStore(*i, freed);
|
||||
bytesFreed += freed;
|
||||
try {
|
||||
unsigned long long freed;
|
||||
deleteFromStore(*i, freed);
|
||||
bytesFreed += freed;
|
||||
} catch (PathInUse & e) {
|
||||
printMsg(lvlError, format("warning: %1%") % e.msg());
|
||||
}
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
if (fdLock != -1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue