Merge ~cjwatson/launchpad:sync-signingkeys-optimise into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 6680d146fbcef2edba25a422e9669609ab193123
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:sync-signingkeys-optimise
Merge into: launchpad:master
Diff against target: 15 lines (+1/-2)
1 file modified
lib/lp/archivepublisher/scripts/sync_signingkeys.py (+1/-2)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+393191@code.launchpad.net

Commit message

Don't materialise all archives in sync-signingkeys

Description of the change

I added this list() call due to an inchoate thought that it might be needed to do stable iteration over the list of archives, but in fact there's no good reason for that since we're ordering by Archive.id anyway. Loading all the archives into the Storm cache up-front made commits unreasonably slow.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archivepublisher/scripts/sync_signingkeys.py b/lib/lp/archivepublisher/scripts/sync_signingkeys.py
2index b3c4e72..a56978e 100644
3--- a/lib/lp/archivepublisher/scripts/sync_signingkeys.py
4+++ b/lib/lp/archivepublisher/scripts/sync_signingkeys.py
5@@ -255,9 +255,8 @@ class SyncSigningKeysScript(LaunchpadScript):
6 transaction.commit()
7
8 def main(self):
9- archives = list(self.getArchives())
10 total = 0
11- for i, archive in enumerate(archives):
12+ for i, archive in enumerate(self.getArchives()):
13 if i != 0 and i % 100 == 0:
14 self._maybeCommit(i)
15 self.logger.debug(

Subscribers

People subscribed via source and target branches

to status/vote changes: