← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging ~cjwatson/launchpad:sync-signingkeys-optimise into launchpad:master.

Commit message:
Don't materialise all archives in sync-signingkeys

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/393191

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.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:sync-signingkeys-optimise into launchpad:master.
diff --git a/lib/lp/archivepublisher/scripts/sync_signingkeys.py b/lib/lp/archivepublisher/scripts/sync_signingkeys.py
index b3c4e72..095d8e4 100644
--- a/lib/lp/archivepublisher/scripts/sync_signingkeys.py
+++ b/lib/lp/archivepublisher/scripts/sync_signingkeys.py
@@ -255,11 +255,15 @@ class SyncSigningKeysScript(LaunchpadScript):
             transaction.commit()
 
     def main(self):
+<<<<<<< lib/lp/archivepublisher/scripts/sync_signingkeys.py
         archives = list(self.getArchives())
         total = 0
         for i, archive in enumerate(archives):
             if i != 0 and i % 100 == 0:
                 self._maybeCommit(i)
+=======
+        for i, archive in enumerate(self.getArchives()):
+>>>>>>> lib/lp/archivepublisher/scripts/sync_signingkeys.py
             self.logger.debug(
                 "#%s - Processing keys for archive %s.", i, archive.reference)
             self.processArchive(archive)