summaryrefslogtreecommitdiffstats
path: root/contrib/sendunsentbugmail.pl
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendunsentbugmail.pl')
-rw-r--r--contrib/sendunsentbugmail.pl21
1 files changed, 10 insertions, 11 deletions
diff --git a/contrib/sendunsentbugmail.pl b/contrib/sendunsentbugmail.pl
index bf31f2d4b..1fad9c891 100644
--- a/contrib/sendunsentbugmail.pl
+++ b/contrib/sendunsentbugmail.pl
@@ -26,24 +26,23 @@ use strict;
use lib qw(.);
require "globals.pl";
+use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::BugMail;
my $dbh = Bugzilla->dbh;
-SendSQL("SELECT bug_id FROM bugs
+
+my $list = $dbh->selectcol_arrayref(
+ 'SELECT bug_id FROM bugs
WHERE lastdiffed IS NULL
- OR lastdiffed < delta_ts AND delta_ts < NOW() - "
- . $dbh->sql_interval(30, 'MINUTE') .
- " ORDER BY bug_id");
-my @list;
-while (MoreSQLData()) {
- push (@list, FetchOneColumn());
-}
+ OR lastdiffed < delta_ts
+ AND delta_ts < NOW() - ' . $dbh->sql_interval(30, 'MINUTE') .
+ ' ORDER BY bug_id');
-if (scalar(@list) > 0) {
+if (scalar(@$list) > 0) {
print "OK, now attempting to send unsent mail\n";
- print scalar(@list) . " bugs found with possibly unsent mail.\n\n";
- foreach my $bugid (@list) {
+ print scalar(@$list) . " bugs found with possibly unsent mail.\n\n";
+ foreach my $bugid (@$list) {
my $start_time = time;
print "Sending mail for bug $bugid...\n";
my $outputref = Bugzilla::BugMail::Send($bugid);