From af119daf37015b8f8f787a6ac9b60e9bc666a4f3 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 3 Aug 2014 18:22:44 +0100 Subject: Publish and Email advisories in order. This should mean that emails are sent out in sequential order --- lib/MGA/Advisories.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm index 48038af..ac0aa9e 100644 --- a/lib/MGA/Advisories.pm +++ b/lib/MGA/Advisories.pm @@ -145,7 +145,7 @@ sub download_advisories { sub publish_advisories { my ($advdb) = @_; - foreach my $adv (keys %{$advdb->{advisories}}) { + foreach my $adv (sort keys %{$advdb->{advisories}}) { next if $advdb->{advisories}{$adv}{status}{published}; $advdb->{advisories}{$adv}{status}{published} = $advdb->{advisories}{$adv}{pubtime} || time(); @@ -254,7 +254,7 @@ sub send_adv_mail { ENCODING => 'utf8', INCLUDE_PATH => $config->{tmpl_dir}, ); - foreach my $adv (keys %{$advdb->{advisories}}) { + foreach my $adv (sort keys %{$advdb->{advisories}}) { next if $advdb->{advisories}{$adv}{no_mail}; next if $advdb->{advisories}{$adv}{no_save_status}; next if $advdb->{advisories}{$adv}{status}{mail_sent}; -- cgit v1.2.1