~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/update-pkgcache.py

  • Committer: William Grant
  • Date: 2011-08-24 05:54:07 UTC
  • mto: This revision was merged to the branch mainline in revision 13785.
  • Revision ID: william.grant@canonical.com-20110824055407-6s7e9w33iwu8ktr4
Update tests.:

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()