Merge lp:~lifeless/launchpad/lessGetLastOops into lp:launchpad

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 11597
Proposed branch: lp:~lifeless/launchpad/lessGetLastOops
Merge into: lp:launchpad
Diff against target: 24 lines (+2/-5)
1 file modified
lib/lp/services/job/runner.py (+2/-5)
To merge this branch: bzr merge lp:~lifeless/launchpad/lessGetLastOops
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+35994@code.launchpad.net

Commit message

Use the oops returned from raising rather than querying disk for (potentially different) OOPS reports.

Description of the change

Remove two more uses of getLastOopsReport which is a slow function (does disk scans) in favour of simply using the returns oops from raising().

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/job/runner.py'
2--- lib/lp/services/job/runner.py 2010-08-20 20:31:18 +0000
3+++ lib/lp/services/job/runner.py 2010-09-20 09:55:59 +0000
4@@ -217,10 +217,8 @@
5 self.logger.exception(
6 "Failed to notify users about a failure.")
7 info = sys.exc_info()
8- self.error_utility.raising(info)
9- oops = self.error_utility.getLastOopsReport()
10 # Returning the oops says something went wrong.
11- return oops
12+ return self.error_utility.raising(info)
13
14 def _doOops(self, job, info):
15 """Report an OOPS for the provided job and info.
16@@ -229,8 +227,7 @@
17 :param info: The standard sys.exc_info() value.
18 :return: the Oops that was reported.
19 """
20- self.error_utility.raising(info)
21- oops = self.error_utility.getLastOopsReport()
22+ oops = self.error_utility.raising(info)
23 job.notifyOops(oops)
24 return oops
25