Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1505050 - make the request nagging script more robust #886

Merged
merged 1 commit into from Nov 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions extensions/RequestNagger/bin/send-request-nags.pl
Expand Up @@ -43,12 +43,11 @@
exit;
}

my $dbh = Bugzilla->dbh;
my $db_date = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
my $db_date = Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)');
my $date = format_time($db_date, '%a, %d %b %Y %T %z', 'UTC');

# delete expired defers
$dbh->do("DELETE FROM nag_defer WHERE defer_until <= CURRENT_DATE()");
Bugzilla->dbh->do("DELETE FROM nag_defer WHERE defer_until <= CURRENT_DATE()");
Bugzilla->switch_to_shadow_db();

# send nags to requestees
Expand Down Expand Up @@ -77,9 +76,10 @@ sub send_nags {
# get requests

foreach my $report (@{ $args{reports} }) {

# collate requests
my $rows = $dbh->selectall_arrayref($args{$report . '_sql'}, { Slice => {} });
my $rows;
Bugzilla->dbh->connector->run(fixup => sub {
$rows = $_->selectall_arrayref($args{$report . '_sql'}, { Slice => {} });
});
foreach my $request (@$rows) {
next unless _include_request($request, $report);

Expand Down