~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/librarian-gc.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-21 14:28:02 UTC
  • mfrom: (14006 devel)
  • mto: This revision was merged to the branch mainline in revision 14010.
  • Revision ID: jelmer@canonical.com-20110921142802-7ggkc204igsy532w
MergeĀ lp:launchpad

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import _pythonpath
18
18
import logging
19
19
 
 
20
from canonical.config import config
 
21
from canonical.database.sqlbase import ISOLATION_LEVEL_AUTOCOMMIT
 
22
from canonical.launchpad.database.librarian import LibraryFileAlias
 
23
from canonical.launchpad.interfaces.lpstorm import IStore
20
24
from canonical.librarian import librariangc
21
 
from canonical.database.sqlbase import ISOLATION_LEVEL_AUTOCOMMIT
22
 
from canonical.config import config
23
25
from lp.services.scripts.base import LaunchpadCronScript
24
26
 
25
27
 
57
59
                help="Skip expiring aliases with an expiry date in the past."
58
60
                )
59
61
 
60
 
 
61
62
    def main(self):
62
63
        librariangc.log = self.logger
63
64
 
64
65
        if self.options.loglevel <= logging.DEBUG:
65
66
            librariangc.debug = True
66
67
 
67
 
        conn = self.txn.conn()
 
68
        # XXX wgrant 2011-09-18 bug=853066: Using Storm's raw connection
 
69
        # here is wrong. We should either create our own or use
 
70
        # Store.execute or cursor() and the transaction module.
 
71
        conn = IStore(LibraryFileAlias)._connection._raw_connection
68
72
 
69
73
        # Refuse to run if we have significant clock skew between the
70
74
        # librarian and the database.