summaryrefslogtreecommitdiffstats
path: root/processmail
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-03-04 07:06:19 +0100
committerbbaetz%student.usyd.edu.au <>2002-03-04 07:06:19 +0100
commit71cf359f2a6fb43f6cc529fb36f41000a7fd796e (patch)
treee33490ebde8174bd05f322e34311ea4c0ed8f17f /processmail
parente13d5c8aba26905724af6ffff0ce5d353c0ced31 (diff)
downloadbugzilla-71cf359f2a6fb43f6cc529fb36f41000a7fd796e.tar.gz
bugzilla-71cf359f2a6fb43f6cc529fb36f41000a7fd796e.tar.xz
Bug 106377 - processmail rescanall should use lastdiffed
r=justdave, ddkilzer@theracingworld.com
Diffstat (limited to 'processmail')
-rwxr-xr-xprocessmail16
1 files changed, 13 insertions, 3 deletions
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 "<br> 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 "<br> Doing bug $id\n";
ProcessOneBug($id);
}
}