~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/buildmaster/manager.py

  • Committer: Jeroen Vermeulen
  • Date: 2011-12-08 11:39:10 UTC
  • mto: This revision was merged to the branch mainline in revision 14459.
  • Revision ID: jeroen.vermeulen@canonical.com-20111208113910-arjwyw8fqx6u2qrn
Cosmetic.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
    # algorithm for polling.
113
113
    SCAN_INTERVAL = 15
114
114
 
115
 
    def __init__(self, builder_name, logger):
 
115
    def __init__(self, builder_name, logger, clock=None):
116
116
        self.builder_name = builder_name
117
117
        self.logger = logger
 
118
        if clock is None:
 
119
            clock = reactor
 
120
        self._clock = clock
118
121
 
119
122
    def startCycle(self):
120
123
        """Scan the builder and dispatch to it or deal with failures."""
121
124
        self.loop = LoopingCall(self.singleCycle)
 
125
        self.loop.clock = self._clock
122
126
        self.stopping_deferred = self.loop.start(self.SCAN_INTERVAL)
123
127
        return self.stopping_deferred
124
128