Skip to content

Commit a1920bd

Browse files
committed
Once verified, cache that good result for the run
1 parent fc938e0 commit a1920bd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

xt/rakudoc-l.rakutest

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ sub is-valid-display($content) {
3131

3232
my %bad-links = BagHash.new;
3333
my $network-testing = %*ENV<NETWORK_TESTING>:exists.so;
34+
my %good-links;
35+
3436
sub is-valid-link($links) {
3537
for @$links -> $link {
3638
if $link.starts-with('/') {
@@ -107,6 +109,12 @@ sub is-valid-link($links) {
107109
# Skip known problematic URLs (403 via Cro, fine via browser)
108110
next if $link eq "https://dev.mysql.com/downloads/repo/apt/";
109111

112+
# auto-pass if we already pulled this session
113+
if %good-links{$link}:exists {
114+
pass "HTTP KNOWN $link";
115+
next;
116+
}
117+
110118
my $response = await $ua.get: $link, user-agent => 'Raku Docs Validator';
111119
CATCH {
112120
when X::Cro::HTTP2::GoAway {
@@ -140,6 +148,7 @@ sub is-valid-link($links) {
140148
}
141149
next;
142150
}
151+
%good-links{$link}++;
143152
pass "HTTP {$response.status} $link";
144153
next;
145154
}

0 commit comments

Comments
 (0)