~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
12
from lp.code.interfaces.branchjob import IBranchScanJobSource
13242.1.11 by Aaron Bentley
Reformat imports.
13
from lp.services.job.runner import (
14
    JobCronScript,
15
    TwistedJobRunner,
16
    )
7675.458.2 by Paul Hummer
Added scan_branches cronscript.
17
18
19
class RunScanBranches(JobCronScript):
20
    """Run BranchScanJob jobs."""
21
22
    config_name = 'branchscanner'
23
    source_interface = IBranchScanJobSource
24
13242.1.9 by Aaron Bentley
Move memory limit from scan_branches to BranchScanJob.
25
    def __init__(self):
26
        super(RunScanBranches, self).__init__(runner_class=TwistedJobRunner)
27
7675.458.2 by Paul Hummer
Added scan_branches cronscript.
28
29
if __name__ == '__main__':
12074.2.1 by Martin Pool
Add 2G address space limit on branch scanner.
30
7675.458.2 by Paul Hummer
Added scan_branches cronscript.
31
    script = RunScanBranches()
32
    script.lock_and_run()