From d4303139f79ce1b862cea544e565f26bfcd5a8a2 Mon Sep 17 00:00:00 2001 From: Aleks-Daniel Jakimenko-Aleksejev Date: Thu, 31 May 2018 22:53:47 +0300 Subject: [PATCH] Do not pull builds when doing fuzzy search It needs to go quickly through lots of revisions, and it is somewhat irrelevant if the build exists or not. Therefore, just use whatever we have, and do not attempt to download builds from the main server. --- lib/Whateverable.pm6 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/Whateverable.pm6 b/lib/Whateverable.pm6 index ea0dd77..bd030bb 100644 --- a/lib/Whateverable.pm6 +++ b/lib/Whateverable.pm6 @@ -340,13 +340,17 @@ sub fetch-build($full-commit-hash, :$backend!) { return $archive } -sub build-exists($full-commit-hash, :$backend=‘rakudo-moar’) is export { +sub build-exists($full-commit-hash, + :$backend=‘rakudo-moar’, + :$force-local=False) is export { my $archive = “{ARCHIVES-LOCATION}/$backend/$full-commit-hash.zst”.IO; my $archive-lts = “{ARCHIVES-LOCATION}/$backend/$full-commit-hash”.IO; # ↑ long-term storage (symlink to a large archive) my $answer = ($archive, $archive-lts).any.e.so; - return so fetch-build $full-commit-hash, :$backend if !$answer && $CONFIG; + if !$force-local && !$answer && $CONFIG { + return so fetch-build $full-commit-hash, :$backend + } $answer } @@ -356,7 +360,8 @@ method get-similar($tag-or-hash, @other?, :$repo=$RAKUDO) { ‘--format=%(*objectname)/%(objectname)/%(refname:strip=2)’, ‘--sort=-taggerdate’).lines .map(*.split(‘/’)) - .grep({ build-exists .[0] || .[1] }) + .grep({ build-exists .[0] || .[1], + :force-local }) .map(*[2]); my $cutoff = $tag-or-hash.chars max 7;