1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 23:13:14 +02:00

Implement a TTL on cached fetchurl/fetchTarball results

This is because we don't want to do HTTP requests on every evaluation,
even though we can prevent a full redownload via the cached ETag. The
default is one hour.
This commit is contained in:
Eelco Dolstra 2015-04-09 11:55:36 +02:00
parent 60340ce3e2
commit c1f04fae35
3 changed files with 34 additions and 13 deletions

View file

@ -143,6 +143,14 @@ bool Settings::get(const string & name, bool def)
}
int Settings::get(const string & name, int def)
{
int res = def;
_get(res, name);
return res;
}
void Settings::update()
{
_get(tryFallback, "build-fallback");