From 71cf359f2a6fb43f6cc529fb36f41000a7fd796e Mon Sep 17 00:00:00 2001
From: "bbaetz%student.usyd.edu.au" <>
Date: Mon, 4 Mar 2002 06:06:19 +0000
Subject: Bug 106377 - processmail rescanall should use lastdiffed r=justdave,
ddkilzer@theracingworld.com
---
processmail | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
(limited to 'processmail')
diff --git a/processmail b/processmail
index 2bea93da6..b5f85e695 100755
--- a/processmail
+++ b/processmail
@@ -831,15 +831,25 @@ if ($#ARGV == 1) {
}
if ($ARGV[0] eq "rescanall") {
- print "
Collecting bug ids...\n";
- SendSQL("select bug_id from bugs where to_days(now()) - to_days(delta_ts) <= 2 order by bug_id");
+ print "Collecting bug ids...\n";
+ SendSQL("select bug_id, lastdiffed, delta_ts from bugs where lastdiffed < delta_ts AND delta_ts < date_sub(now(), INTERVAL 30 minute) order by bug_id");
my @list;
while (my @row = FetchSQLData()) {
+ my $time = $row[2];
+ if ($time =~ /^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
+ $time = "$1-$2-$3 $4:$5:$6";
+ }
+ print STDERR "Bug $row[0] has unsent mail. lastdiffed is $row[1], delta_ts is $time.\n";
push @list, $row[0];
}
+ if (scalar(@list) > 0) {
+ print STDERR scalar(@list) . " bugs found with possibly unsent mail\n";
+ print STDERR "Updating bugs, sending mail if required\n";
+ } else {
+ print "All appropriate mail appears to have been sent\n"
+ }
foreach my $id (@list) {
if (detaint_natural($id)) {
- print "
Doing bug $id\n";
ProcessOneBug($id);
}
}
--
cgit v1.2.3-24-g4f1b