Skip to content

Commit

Permalink
Do not pull builds when doing fuzzy search
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlexDaniel committed May 31, 2018
1 parent 6260f76 commit d430313
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/Whateverable.pm6
Expand Up @@ -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<mothership>;
if !$force-local && !$answer && $CONFIG<mothership> {
return so fetch-build $full-commit-hash, :$backend
}
$answer
}

Expand All @@ -356,7 +360,8 @@ method get-similar($tag-or-hash, @other?, :$repo=$RAKUDO) {
--format=%(*objectname)/%(objectname)/%(refname:strip=2),
--sort=-taggerdate)<output>.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;
Expand Down

0 comments on commit d430313

Please sign in to comment.