Skip to content

Commit

Permalink
optimize: test-links.pl: avoid testing duplicate links.
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Sep 1, 2020
1 parent 49330b1 commit 39ffde4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions v2/util/test-links.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
use strict;
use warnings;

my %seen_links;

my $i = 0;

sub test_link ($) {
my $link = shift;

return if $seen_links{$link};
$seen_links{$link} = 1;

return if $link =~ /\b(?:foo|example|blah)\.com\b/ || /\bmybackend\b/;
my $out = `curl -I -sS '$link'`;
#print "$link\n";
Expand Down

0 comments on commit 39ffde4

Please sign in to comment.