From 14a992f3f26e6c58003a729a6773bb0902ba431e Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 15 May 2006 23:06:59 +0000 Subject: Bug 303709: Eliminate deprecated Bugzilla::DB routines from sendbugmail.pl, sendunsentbugmail.pl and syncLDAP.pl scripts in contrib - Patch by Olav Vitters r=LpSolit a=justdave --- contrib/sendunsentbugmail.pl | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'contrib/sendunsentbugmail.pl') 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); -- cgit v1.2.3-24-g4f1b