From 1999263c21ff9b5321ecc7ed268822e4d7be74e5 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 22 Jun 2018 21:03:19 +0200 Subject: Deduplicate protocol list in mirror mails Signed-off-by: Florian Pritz --- bin/generate-mirror-mail.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 () { 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; -- cgit v1.2.3-24-g4f1b