diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-06-22 21:03:19 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-06-22 21:03:19 +0200 |
commit | 1999263c21ff9b5321ecc7ed268822e4d7be74e5 (patch) | |
tree | 76e11773fbac5056ae484dd66bd0317d63ce9082 | |
parent | a23a0874d15482df8fe89b3ac86d39eac2e7b705 (diff) | |
download | arch-mirror-tools-1999263c21ff9b5321ecc7ed268822e4d7be74e5.tar.gz arch-mirror-tools-1999263c21ff9b5321ecc7ed268822e4d7be74e5.tar.xz |
Deduplicate protocol list in mirror mails
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | bin/generate-mirror-mail.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/generate-mirror-mail.pl b/bin/generate-mirror-mail.pl index c6e8a19..175b8b2 100755 --- a/bin/generate-mirror-mail.pl +++ b/bin/generate-mirror-mail.pl @@ -8,6 +8,7 @@ use Date::Parse; use File::Basename; use HTTP::Cookies; use JSON; +use List::Util qw(uniq); use Text::Template; use Try::Tiny; use WWW::Mechanize; @@ -197,7 +198,7 @@ while (<STDIN>) { mail_from_name => $Config->{misc}->{name} // die "misc.name not set in config", ); - my @protocols = map {${$_}{protocol}} @connection_failed; + my @protocols = uniq map {${$_}{protocol}} @connection_failed; my @active_urls = grep { $_->{active} } @{$json->{urls}}; if (scalar(@protocols) != scalar(@active_urls)) { $values{connection_failed}->{protocols} = \@protocols; |