diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-06-20T09·55+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-06-20T09·55+0200 |
commit | 22144afa8d9f8968da351618a1347072a93bd8aa (patch) | |
tree | f0ebe5edf3a480a9d9afd637b9056e352e049541 /perl | |
parent | 2b29e4b8529ec9f4d6904a5142266c02d1b24c99 (diff) |
Don't keep "disabled" substituters running
For instance, it's pointless to keep copy-from-other-stores running if there are no other stores, or download-using-manifests if there are no manifests. This also speeds things up because we don't send queries to those substituters.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/lib/Nix/Manifest.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perl/lib/Nix/Manifest.pm b/perl/lib/Nix/Manifest.pm index ed43900b5c53..50e354c0c5bd 100644 --- a/perl/lib/Nix/Manifest.pm +++ b/perl/lib/Nix/Manifest.pm @@ -227,6 +227,9 @@ sub writeManifest { sub updateManifestDB { my $manifestDir = $Nix::Config::manifestDir; + my @manifests = glob "$manifestDir/*.nixmanifest"; + return undef if scalar @manifests == 0; + mkpath($manifestDir); unlink "$manifestDir/cache.sqlite"; # remove obsolete cache @@ -311,7 +314,7 @@ EOF # unless we've already done so on a previous run. my %seen; - for my $manifestLink (glob "$manifestDir/*.nixmanifest") { + for my $manifestLink (@manifests) { my $manifest = Cwd::abs_path($manifestLink); next unless -f $manifest; my $timestamp = lstat($manifest)->mtime; |