forked from lix-project/hydra
Check if we want to send email for a build before iterating through its users
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
117ae78a45
commit
93a14ccf32
1 changed files with 12 additions and 12 deletions
|
@ -52,11 +52,6 @@ sub buildFinished {
|
||||||
my %addresses;
|
my %addresses;
|
||||||
foreach my $b ($build, @{$dependents}) {
|
foreach my $b ($build, @{$dependents}) {
|
||||||
my $prevBuild = getPreviousBuild($b);
|
my $prevBuild = getPreviousBuild($b);
|
||||||
my $to = $b->jobset->emailoverride ne "" ? $b->jobset->emailoverride : $b->maintainers;
|
|
||||||
|
|
||||||
foreach my $address (split ",", $to) {
|
|
||||||
$address = trim $address;
|
|
||||||
|
|
||||||
# Do we want to send mail for this build?
|
# Do we want to send mail for this build?
|
||||||
unless ($ENV{'HYDRA_FORCE_SEND_MAIL'}) {
|
unless ($ENV{'HYDRA_FORCE_SEND_MAIL'}) {
|
||||||
next unless $b->jobset->enableemail;
|
next unless $b->jobset->enableemail;
|
||||||
|
@ -69,6 +64,11 @@ sub buildFinished {
|
||||||
next if defined $prevBuild && ($b->buildstatus == $prevBuild->buildstatus);
|
next if defined $prevBuild && ($b->buildstatus == $prevBuild->buildstatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $to = $b->jobset->emailoverride ne "" ? $b->jobset->emailoverride : $b->maintainers;
|
||||||
|
|
||||||
|
foreach my $address (split ",", $to) {
|
||||||
|
$address = trim $address;
|
||||||
|
|
||||||
$addresses{$address} //= { builds => [] };
|
$addresses{$address} //= { builds => [] };
|
||||||
push @{$addresses{$address}->{builds}}, $b;
|
push @{$addresses{$address}->{builds}}, $b;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue