← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/publish-distro-faster-no-op into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/publish-distro-faster-no-op into lp:launchpad.

Commit message:
Avoid creating a Publisher if publish-distro is going to skip an archive.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/publish-distro-faster-no-op/+merge/290418

Avoid creating a Publisher if publish-distro is going to skip an archive.  This only costs about a hundredth of a second per skipped archive, but that adds up when we're doing something like re-signing all published archives.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/publish-distro-faster-no-op into lp:launchpad.
=== modified file 'lib/lp/archivepublisher/scripts/publishdistro.py'
--- lib/lp/archivepublisher/scripts/publishdistro.py	2016-03-23 15:01:32 +0000
+++ lib/lp/archivepublisher/scripts/publishdistro.py	2016-03-30 09:43:09 +0000
@@ -331,12 +331,13 @@
         for distribution in self.findDistros():
             allowed_suites = self.findAllowedSuites(distribution)
             for archive in self.getTargetArchives(distribution):
-                publisher = self.getPublisher(
-                    distribution, archive, allowed_suites)
-
                 if archive.status == ArchiveStatus.DELETING:
+                    publisher = self.getPublisher(
+                        distribution, archive, allowed_suites)
                     work_done = self.deleteArchive(archive, publisher)
                 elif archive.can_be_published:
+                    publisher = self.getPublisher(
+                        distribution, archive, allowed_suites)
                     for suite in self.options.dirty_suites:
                         distroseries, pocket = self.findSuite(
                             distribution, suite)


Follow ups