diff options
author | mkanat%bugzilla.org <> | 2009-08-06 14:59:37 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-08-06 14:59:37 +0000 |
commit | c427a6f710a60ffbca41b3cca62de949f1407059 (patch) | |
tree | 789b7438560bd9f6d517c6ed0d3a187bb7c89b0b | |
parent | d59420c868fc8f529d2070c3acc4a419c39f1dbb (diff) | |
download | bugs-c427a6f710a60ffbca41b3cca62de949f1407059.tar bugs-c427a6f710a60ffbca41b3cca62de949f1407059.tar.gz bugs-c427a6f710a60ffbca41b3cca62de949f1407059.tar.bz2 bugs-c427a6f710a60ffbca41b3cca62de949f1407059.tar.xz bugs-c427a6f710a60ffbca41b3cca62de949f1407059.zip |
Bug 508729: Cache Bugzilla::Status::BUG_STATE_OPEN
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
-rw-r--r-- | Bugzilla/Status.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Bugzilla/Status.pm b/Bugzilla/Status.pm index 289e17260..4720dc129 100644 --- a/Bugzilla/Status.pm +++ b/Bugzilla/Status.pm @@ -66,6 +66,7 @@ sub VALIDATORS { sub create { my $class = shift; my $self = $class->SUPER::create(@_); + delete Bugzilla->request_cache->{status_bug_state_open}; add_missing_bug_status_transitions(); return $self; } @@ -80,6 +81,7 @@ sub remove_from_db { WHERE old_status = ? OR new_status = ?', undef, $id, $id); $dbh->bz_commit_transaction(); + delete Bugzilla->request_cache->{status_bug_state_open}; } ############################### @@ -120,9 +122,12 @@ sub _check_value { ############################### sub BUG_STATE_OPEN { - # XXX - We should cache this list. my $dbh = Bugzilla->dbh; - return @{$dbh->selectcol_arrayref('SELECT value FROM bug_status WHERE is_open = 1')}; + my $cache = Bugzilla->request_cache; + $cache->{status_bug_state_open} ||= + $dbh->selectcol_arrayref('SELECT value FROM bug_status + WHERE is_open = 1'); + return @{ $cache->{status_bug_state_open} }; } # Tells you whether or not the argument is a valid "open" state. |