mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
Reserve some disk space for the garbage collector
We can't open a SQLite database if the disk is full. Since this prevents the garbage collector from running when it's most needed, we reserve some dummy space that we can free just before doing a garbage collection. This actually revives some old code from the Berkeley DB days. Fixes #27.
This commit is contained in:
parent
2c26985835
commit
4bc4da331a
9 changed files with 35 additions and 11 deletions
|
@ -322,10 +322,10 @@ namespace nix {
|
|||
boost::shared_ptr<StoreAPI> store;
|
||||
|
||||
|
||||
boost::shared_ptr<StoreAPI> openStore()
|
||||
boost::shared_ptr<StoreAPI> openStore(bool reserveSpace)
|
||||
{
|
||||
if (getEnv("NIX_REMOTE") == "")
|
||||
return boost::shared_ptr<StoreAPI>(new LocalStore());
|
||||
return boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
|
||||
else
|
||||
return boost::shared_ptr<StoreAPI>(new RemoteStore());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue