Merge lp:~cjwatson/launchpad/gina-dsc-binaries into lp:launchpad

Proposed by Colin Watson
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 14646
Proposed branch: lp:~cjwatson/launchpad/gina-dsc-binaries
Merge into: lp:launchpad
Diff against target: 25 lines (+4/-0)
2 files modified
lib/lp/scripts/garbo.py (+1/-0)
lib/lp/services/looptuner.py (+3/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/gina-dsc-binaries
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+87732@code.launchpad.net

Commit message

Fix SourcePackageReleaseDscBinariesUpdater: round chunk_size to int (and document this issue).

Description of the change

Fix QA badness from the previous merge of this branch (chunk_size is a float, not an int), and document this "feature" so I might not trip over it again.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/scripts/garbo.py'
2--- lib/lp/scripts/garbo.py 2012-01-05 21:38:46 +0000
3+++ lib/lp/scripts/garbo.py 2012-01-06 11:56:32 +0000
4@@ -927,6 +927,7 @@
5
6 def __call__(self, chunk_size):
7 """See `TunableLoop`."""
8+ chunk_size = int(chunk_size + 0.5)
9 chunk_ids = self.ids[:chunk_size]
10 del self.ids[:chunk_size]
11 self.store.execute("""
12
13=== modified file 'lib/lp/services/looptuner.py'
14--- lib/lp/services/looptuner.py 2012-01-01 02:58:52 +0000
15+++ lib/lp/services/looptuner.py 2012-01-06 11:56:32 +0000
16@@ -49,6 +49,9 @@
17 The chunk_size parameter says (in some way you define) how much work
18 the LoopTuner believes you should try to do in this iteration in order
19 to get as close as possible to your time goal.
20+
21+ Note that chunk_size is a float, so, for example, if you use it to
22+ slice a list, be careful to round it to an int first.
23 """
24
25 def cleanUp(self):