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
=== modified file 'lib/lp/services/job/runner.py'
--- lib/lp/services/job/runner.py 2010-08-20 20:31:18 +0000
+++ lib/lp/services/job/runner.py 2010-09-20 09:55:59 +0000
@@ -217,10 +217,8 @@
217 self.logger.exception(217 self.logger.exception(
218 "Failed to notify users about a failure.")218 "Failed to notify users about a failure.")
219 info = sys.exc_info()219 info = sys.exc_info()
220 self.error_utility.raising(info)
221 oops = self.error_utility.getLastOopsReport()
222 # Returning the oops says something went wrong.220 # Returning the oops says something went wrong.
223 return oops221 return self.error_utility.raising(info)
224222
225 def _doOops(self, job, info):223 def _doOops(self, job, info):
226 """Report an OOPS for the provided job and info.224 """Report an OOPS for the provided job and info.
@@ -229,8 +227,7 @@
229 :param info: The standard sys.exc_info() value.227 :param info: The standard sys.exc_info() value.
230 :return: the Oops that was reported.228 :return: the Oops that was reported.
231 """229 """
232 self.error_utility.raising(info)230 oops = self.error_utility.raising(info)
233 oops = self.error_utility.getLastOopsReport()
234 job.notifyOops(oops)231 job.notifyOops(oops)
235 return oops232 return oops
236233