← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/gina-dsc-binaries into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #911943 in Launchpad itself: "gina imports SourcePackageRelease.dsc_binaries incorrectly"
  https://bugs.launchpad.net/launchpad/+bug/911943

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/gina-dsc-binaries/+merge/87732

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.
-- 
https://code.launchpad.net/~cjwatson/launchpad/gina-dsc-binaries/+merge/87732
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/gina-dsc-binaries into lp:launchpad.
=== modified file 'lib/lp/scripts/garbo.py'
--- lib/lp/scripts/garbo.py	2012-01-05 21:38:46 +0000
+++ lib/lp/scripts/garbo.py	2012-01-06 11:56:32 +0000
@@ -927,6 +927,7 @@
 
     def __call__(self, chunk_size):
         """See `TunableLoop`."""
+        chunk_size = int(chunk_size + 0.5)
         chunk_ids = self.ids[:chunk_size]
         del self.ids[:chunk_size]
         self.store.execute("""

=== modified file 'lib/lp/services/looptuner.py'
--- lib/lp/services/looptuner.py	2012-01-01 02:58:52 +0000
+++ lib/lp/services/looptuner.py	2012-01-06 11:56:32 +0000
@@ -49,6 +49,9 @@
         The chunk_size parameter says (in some way you define) how much work
         the LoopTuner believes you should try to do in this iteration in order
         to get as close as possible to your time goal.
+
+        Note that chunk_size is a float, so, for example, if you use it to
+        slice a list, be careful to round it to an int first.
         """
 
     def cleanUp(self):