~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/update-pkgcache.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-25 06:23:33 UTC
  • mfrom: (13757.2.12 dspc-out-of-distribution)
  • Revision ID: launchpad@pqm.canonical.com-20110825062333-blka2u2wcyoc3jn3
[r=sinzui][no-qa] Move DistributionPackageCache maintenance methods
 out of Distribution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
from lp.registry.interfaces.distribution import IDistributionSet
17
17
from lp.services.scripts.base import LaunchpadCronScript
 
18
from lp.soyuz.model.distributionsourcepackagecache import (
 
19
    DistributionSourcePackageCache)
18
20
from lp.soyuz.model.distroseriespackagecache import DistroSeriesPackageCache
19
21
 
20
22
 
50
52
        for distroseries in distribution.series:
51
53
            self.updateDistroSeriesCache(distroseries, archive)
52
54
 
53
 
        distribution.removeOldCacheItems(archive, log=self.logger)
 
55
        DistributionSourcePackageCache.removeOld(
 
56
            distribution, archive, log=self.logger)
54
57
 
55
 
        updates = distribution.updateCompleteSourcePackageCache(
56
 
            archive=archive, ztm=self.txn, log=self.logger)
 
58
        updates = DistributionSourcePackageCache.updateAll(
 
59
            distribution, archive=archive, ztm=self.txn, log=self.logger)
57
60
 
58
61
        if updates > 0:
59
62
            self.txn.commit()