Merge lp://staging/~jtv/launchpad/bug-423150 into lp://staging/launchpad

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~jtv/launchpad/bug-423150
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~jtv/launchpad/bug-423150
Reviewer Review Type Date Requested Status
Henning Eggers (community) code Approve
Review via email: mp+11111@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

= Bug 423150 =

This branch is meant for cherry-picking.

The translations importer is hitting an over-strict shortlist limit.
There were too many products with uploads approved for import.

This branch removes the limit altogether. When too many files are
stuck waiting to be imported, the last thing we want to do is break
the import script—which is the one thing that'll get rid of them.

Tests: 'translations.*import'

No lint complaints.

Jeroen

Revision history for this message
Henning Eggers (henninge) wrote :

The code is ok but for a CP the change from sort to orderBy might be considered superflouus. But I am not approving a CP here ... ;-)

Thanks for the quick fix!

Henning

review: Approve (code)
Revision history for this message
Данило Шеган (danilo) wrote :

How about we fix the distroseries listing now as well? We are at 11 distroseries for Ubuntu now, and there's probably no reason to keep the limit there ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/model/translationimportqueue.py'
2--- lib/lp/translations/model/translationimportqueue.py 2009-08-06 04:29:04 +0000
3+++ lib/lp/translations/model/translationimportqueue.py 2009-09-03 05:14:07 +0000
4@@ -1041,9 +1041,6 @@
5 status_clause = (
6 "TranslationImportQueueEntry.status = %s" % sqlvalues(status))
7
8- def product_sort_key(product):
9- return product.name
10-
11 def distroseries_sort_key(distroseries):
12 return (distroseries.distribution.name, distroseries.name)
13
14@@ -1054,11 +1051,10 @@
15 if status is not None:
16 query.append(status_clause)
17
18- products = shortlist(Product.select(
19+ products = list(Product.select(
20 ' AND '.join(query),
21 clauseTables=['ProductSeries', 'TranslationImportQueueEntry'],
22- distinct=True))
23- products.sort(key=product_sort_key)
24+ distinct=True, orderBy='Product.name'))
25
26 distroseriess = shortlist(DistroSeries.select("""
27 defer_translation_imports IS FALSE AND