From 4a8e3d64a5af8ae7a82cdb7bbbc39afbf38184b4 Mon Sep 17 00:00:00 2001 From: "preed%sigkill.com" <> Date: Mon, 10 Feb 2003 06:04:08 +0000 Subject: Bug 124174 - make processmail a package (Bugzilla::BugMail), r=gerv, r=jth, a=justdave --- sanitycheck.cgi | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'sanitycheck.cgi') diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 49c007f7f..f5b8be210 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -150,6 +150,31 @@ if (exists $::FORM{'cleangroupsnow'}) { "- reduced from $before records to $after records"); } +if (exists $::FORM{'rescanallBugMail'}) { + require Bugzilla::BugMail; + + Status("OK, now attempting to send unsent mail"); + SendSQL("SELECT bug_id FROM bugs WHERE lastdiffed < delta_ts AND + delta_ts < date_sub(now(), INTERVAL 30 minute) ORDER BY bug_id"); + my @list; + while (MoreSQLData()) { + push (@list, FetchOneColumn()); + } + + Status(scalar(@list) . ' bugs found with possibly unsent mail.'); + + foreach my $bugid (@list) { + Bugzilla::BugMail::Send($bugid); + } + + if (scalar(@list) > 0) { + Status("Unsent mail has been sent."); + } + + PutFooter(); + exit; +} + print "OK, now running sanity checks.

\n"; ########################################################################### @@ -683,7 +708,7 @@ while (@row = FetchSQLData()) { if (@badbugs > 0) { Alert("Bugs that have changes but no mail sent for at least half an hour: " . join (", ", @badbugs)); - print("Run processmail rescanall to fix this

\n"); + print qq{Send these mails.

\n}; } ########################################################################### -- cgit v1.2.3-24-g4f1b