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:
parent
60340ce3e2
commit
c1f04fae35
3 changed files with 34 additions and 13 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue