~launchpad-pqm/launchpad/devel

10637.3.1 by Guilherme Salgado
Use the default python version instead of a hard-coded version
1
#!/usr/bin/python -S
7675.458.2 by Paul Hummer
Added scan_branches cronscript.
2
#
7675.458.9 by Paul Hummer
Fixed a copyright notice and a docstring.
3
# Copyright 2010 Canonical Ltd.  This software is licensed under the
7675.458.2 by Paul Hummer
Added scan_branches cronscript.
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
6
"""Scan branches for new revisions."""
7
8
__metaclass__ = type
9
10
import _pythonpath
11
12074.2.1 by Martin Pool
Add 2G address space limit on branch scanner.
12
import resource
13
7675.458.2 by Paul Hummer
Added scan_branches cronscript.
14
from lp.services.job.runner import JobCronScript
15
from lp.code.interfaces.branchjob import IBranchScanJobSource
16
17
18
class RunScanBranches(JobCronScript):
19
    """Run BranchScanJob jobs."""
20
21
    config_name = 'branchscanner'
22
    source_interface = IBranchScanJobSource
23
24
25
if __name__ == '__main__':
12074.2.1 by Martin Pool
Add 2G address space limit on branch scanner.
26
27
    resource.setrlimit(resource.RLIMIT_AS, (2L << 30, 2L << 30))
28
7675.458.2 by Paul Hummer
Added scan_branches cronscript.
29
    script = RunScanBranches()
30
    script.lock_and_run()