[bugzilla-gnome-org-extensions] Make loading of trace_text lazy, to speed up loading of trace.html.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bugzilla-gnome-org-extensions] Make loading of trace_text lazy, to speed up loading of trace.html.
- Date: Thu, 20 Nov 2014 22:13:16 +0000 (UTC)
commit 814a58095bdc236d8f6a802a4cae4e26a41f14ab
Author: Max Kanat-Alexander <mkanat everythingsolved com>
Date: Thu Aug 6 01:16:59 2009 -0500
Make loading of trace_text lazy, to speed up loading of trace.html.
lib/TraceParser/Trace.pm | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/lib/TraceParser/Trace.pm b/lib/TraceParser/Trace.pm
index 77243c1..f8a8ff1 100644
--- a/lib/TraceParser/Trace.pm
+++ b/lib/TraceParser/Trace.pm
@@ -40,7 +40,6 @@ use constant DB_COLUMNS => qw(
short_hash
stack_hash
trace_hash
- trace_text
type
quality
);
@@ -191,13 +190,20 @@ sub comment_id { return $_[0]->{comment_id}; }
sub stack_hash { return $_[0]->{stack_hash}; }
sub short_hash { return $_[0]->{short_hash}; }
sub trace_hash { return $_[0]->{trace_hash}; }
-sub text { return $_[0]->{trace_text}; }
sub type { return $_[0]->{type}; }
sub quality {
my $self = shift;
return sprintf('%.1f', $self->{quality});
}
+sub text {
+ my $self = shift;
+ $self->{text} ||= Bugzilla->dbh->selectrow_array(
+ 'SELECT trace_text FROM trace WHERE id = ?',
+ undef, $self->id);
+ return $self->{text};
+}
+
sub bug {
my $self = shift;
return $self->{bug} if exists $self->{bug};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]