summaryrefslogtreecommitdiffstats
path: root/contrib/sendunsentbugmail.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-05-16 01:06:59 +0200
committerlpsolit%gmail.com <>2006-05-16 01:06:59 +0200
commit14a992f3f26e6c58003a729a6773bb0902ba431e (patch)
tree4458f842d3dd8296f1b00cd6605b9a1293557711 /contrib/sendunsentbugmail.pl
parentea5339f6b43fc25894639b57a8af6819b7f4e079 (diff)
downloadbugzilla-14a992f3f26e6c58003a729a6773bb0902ba431e.tar.gz
bugzilla-14a992f3f26e6c58003a729a6773bb0902ba431e.tar.xz
Bug 303709: Eliminate deprecated Bugzilla::DB routines from sendbugmail.pl, sendunsentbugmail.pl and syncLDAP.pl scripts in contrib - Patch by Olav Vitters <bugzilla-mozilla@bkor.dhs.org> r=LpSolit a=justdave
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);