summaryrefslogtreecommitdiffstats
path: root/sanitycheck.cgi
diff options
context:
space:
mode:
authorpreed%sigkill.com <>2003-02-10 07:04:08 +0100
committerpreed%sigkill.com <>2003-02-10 07:04:08 +0100
commit4a8e3d64a5af8ae7a82cdb7bbbc39afbf38184b4 (patch)
treea04456cea027c8f56eba8a6a433f34eb3b11a4fb /sanitycheck.cgi
parent731b5775ed45d22398a6c7969bd62922853c3b4e (diff)
downloadbugzilla-4a8e3d64a5af8ae7a82cdb7bbbc39afbf38184b4.tar.gz
bugzilla-4a8e3d64a5af8ae7a82cdb7bbbc39afbf38184b4.tar.xz
Bug 124174 - make processmail a package (Bugzilla::BugMail), r=gerv, r=jth, a=justdave
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-xsanitycheck.cgi27
1 files changed, 26 insertions, 1 deletions
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.<p>\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 <code>processmail rescanall</code> to fix this<p>\n");
+ print qq{<a href="sanitycheck.cgi?rescanallBugMail=1">Send these mails</a>.<p>\n};
}
###########################################################################