ProductReleaseFileMixin.latest_release_with_download_files is inefficient for projects with many releases

Bug #1892003 reported by Colin Watson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
High
Unassigned

Bug Description

See: https://oops.canonical.com/?oopsid=OOPS-31b11f108e721633529066220ca65fdd

There are possibly multiple problems here, but one that jumps out at me is:

    @cachedproperty
    def latest_release_with_download_files(self):
        """Return the latest release with download files."""
        for series in self.sorted_active_series_list:
            for release in series.releases:
                if len(list(release.files)) > 0:
                    return release
        return None

This needs to be replaced with a more targeted query.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.