diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-08-25T16·54+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-08-25T16·54+0000 |
commit | eb233e728f06ec2b5cbcfc85059fa91a1150f291 (patch) | |
tree | 81cf94bd444b36f83fe489f2ae0061b0ae32fd1b /src/libstore/gc.hh | |
parent | fdec72c6cc720be899431c32f99221e8c4b88cd0 (diff) |
* `--min-age' flag in nix-store and nix-collect-garbage to only delete
unreachable paths that haven't been used for N hours. For instance, `nix-collect-garbage --min-age 168' only deletes paths that haven't been accessed in the last week. This is useful for instance in the build farm where many derivations can be shared between consecutive builds, and we wouldn't want a garbage collect to throw them all away. We could of course register them as roots, but then we'd to unregister them at some point, which would be a pain to manage. The `--min-age' flag gives us a sort of MRU caching scheme. BUG: this really shouldn't be in gc.cc since that violates mechanism/policy separation.
Diffstat (limited to 'src/libstore/gc.hh')
-rw-r--r-- | src/libstore/gc.hh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/gc.hh b/src/libstore/gc.hh index 997057ba9b7b..1ada419da439 100644 --- a/src/libstore/gc.hh +++ b/src/libstore/gc.hh @@ -17,8 +17,10 @@ PathSet findLivePaths(const Paths & roots); /* Given a set of "live" store paths, determine the set of "dead" store paths (which are simply all store paths that are not in the - live set). */ -PathSet findDeadPaths(const PathSet & live); + live set). The value `minAge' specifies the minimum age in seconds + for an unreachable file to be considered dead (0 meaning that any + unreachable file is dead). */ +PathSet findDeadPaths(const PathSet & live, time_t minAge); #endif /* !__GC_H */ |