Merge lp:~achiang/laika/last_modified into lp:laika

Proposed by Alex Chiang
Status: Merged
Merged at revision: 14
Proposed branch: lp:~achiang/laika/last_modified
Merge into: lp:laika
Diff against target: 41 lines (+7/-3)
1 file modified
laika (+7/-3)
To merge this branch: bzr merge lp:~achiang/laika/last_modified
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+40404@code.launchpad.net

Description of the change

Pass a 'last_modified' arg to searchTasks()

Limit our search for bugs within the user-specified window. This change
can improve our search performance by several hundred percent, reducing
a former 9 minute query down to 3 minutes and change, e.g.

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'laika'
--- laika 2010-11-09 03:56:38 +0000
+++ laika 2010-11-09 04:26:02 +0000
@@ -43,6 +43,7 @@
4343
44 self.user = self.launchpad.people[user]44 self.user = self.launchpad.people[user]
45 self.window = window45 self.window = window
46 self.since = UTCNOW - datetime.timedelta(window)
46 self.ppas = ppas47 self.ppas = ppas
47 self.status = ["New",48 self.status = ["New",
48 "Incomplete",49 "Incomplete",
@@ -95,7 +96,8 @@
95 'in_progress', 'triaged', 'confirmed', 'created']96 'in_progress', 'triaged', 'confirmed', 'created']
9697
97 tasks = self.user.searchTasks(assignee=self.user,98 tasks = self.user.searchTasks(assignee=self.user,
98 status=self.status)99 status=self.status,
100 modified_since=self.since)
99 self.print_header("Assigned Bugs")101 self.print_header("Assigned Bugs")
100102
101 for t in tasks:103 for t in tasks:
@@ -120,7 +122,8 @@
120122
121 def print_comments(self):123 def print_comments(self):
122 tasks = self.user.searchTasks(bug_commenter=self.user,124 tasks = self.user.searchTasks(bug_commenter=self.user,
123 status=self.status)125 status=self.status,
126 modified_since=self.since)
124 self.print_header("Commented Bugs")127 self.print_header("Commented Bugs")
125 for t in tasks:128 for t in tasks:
126 if self.bugs.has_key(t.bug.id):129 if self.bugs.has_key(t.bug.id):
@@ -136,7 +139,8 @@
136139
137 def print_reported(self):140 def print_reported(self):
138 tasks = self.user.searchTasks(bug_reporter=self.user,141 tasks = self.user.searchTasks(bug_reporter=self.user,
139 status=self.status)142 status=self.status,
143 modified_since=self.since)
140 self.print_header("Reported Bugs")144 self.print_header("Reported Bugs")
141 for t in tasks:145 for t in tasks:
142 if self.bugs.has_key(t.bug.id):146 if self.bugs.has_key(t.bug.id):

Subscribers

People subscribed via source and target branches

to all changes: