From 0f2dd8d714a424cf383d925f8b55a098716b0660 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 2 Sep 2015 13:41:48 +0800 Subject: Bug 1199136 - lower memory consumption to better operate in bugzilladm's low memory environment --- scripts/update-bug-groups.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/update-bug-groups.pl b/scripts/update-bug-groups.pl index cec3d4696..173269e7c 100755 --- a/scripts/update-bug-groups.pl +++ b/scripts/update-bug-groups.pl @@ -75,10 +75,9 @@ print "Query matched $count bug(s)\nPress to stop or to continu getc(); my $dbh = Bugzilla->dbh; -$dbh->bz_start_transaction; - my $updated = 0; foreach my $ra (@$bugs) { + $dbh->bz_start_transaction; my ($bug_id, $summary) = @$ra; print "$bug_id - $summary\n"; my $bug = Bugzilla::Bug->check($bug_id); @@ -89,8 +88,10 @@ foreach my $ra (@$bugs) { $dbh->do("UPDATE bugs SET lastdiffed = delta_ts WHERE bug_id = ?", undef, $bug->id); $updated++; } -} + $dbh->bz_commit_transaction; -$dbh->bz_commit_transaction; + # drop cached user objects to avoid excessive memory usage + Bugzilla::User->object_cache_clearall(); +} print "\nUpdated $updated bugs(s)\n"; -- cgit v1.2.3-24-g4f1b