~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/librarian-gc.py

  • Committer: Jeroen Vermeulen
  • Date: 2011-09-26 06:30:07 UTC
  • mto: This revision was merged to the branch mainline in revision 14049.
  • Revision ID: jeroen.vermeulen@canonical.com-20110926063007-1fb5eelnidpnra9a
Fix lots of lint in recently-changed files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python -S
2
2
#
3
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
3
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
4
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
5
 
6
6
# pylint: disable-msg=C0103,W0403
14
14
 
15
15
__metaclass__ = type
16
16
 
 
17
import logging
 
18
 
17
19
import _pythonpath
18
 
import logging
19
20
 
20
21
from canonical.config import config
21
22
from canonical.database.sqlbase import ISOLATION_LEVEL_AUTOCOMMIT
79
80
        if not self.options.skip_expiry:
80
81
            librariangc.expire_aliases(conn)
81
82
        if not self.options.skip_content:
82
 
            librariangc.delete_unreferenced_content(conn) # first sweep
 
83
            # First sweep.
 
84
            librariangc.delete_unreferenced_content(conn)
83
85
        if not self.options.skip_blobs:
84
86
            librariangc.delete_expired_blobs(conn)
85
87
        if not self.options.skip_duplicates:
87
89
        if not self.options.skip_aliases:
88
90
            librariangc.delete_unreferenced_aliases(conn)
89
91
        if not self.options.skip_content:
90
 
            librariangc.delete_unreferenced_content(conn) # second sweep
 
92
            # Second sweep.
 
93
            librariangc.delete_unreferenced_content(conn)
91
94
        if not self.options.skip_files:
92
95
            librariangc.delete_unwanted_files(conn)
93
96
 
96
99
    script = LibrarianGC('librarian-gc',
97
100
                         dbuser=config.librarian_gc.dbuser)
98
101
    script.lock_and_run(isolation=ISOLATION_LEVEL_AUTOCOMMIT)
99