Beispiel #1
0
def setup(app):
    if CONF.periodic_enable:
        if CONF.periodic_fuzzy_delay:
            initial_delay = random.randint(0, CONF.periodic_fuzzy_delay)
            LOG.debug("Starting periodic tasks with initial delay '%s' "
                      "seconds", initial_delay)
        else:
            initial_delay = None

        app.tg = threadgroup.ThreadGroup()
        pt = SavannaPeriodicTasks()
        app.tg.add_dynamic_timer(
            pt.run_periodic_tasks,
            initial_delay=initial_delay,
            periodic_interval_max=CONF.periodic_interval_max,
            context=None)
Beispiel #2
0
 def __init__(self):
     self.services = []
     self.tg = threadgroup.ThreadGroup()
     self.done = event.Event()
Beispiel #3
0
    def __init__(self, threads=1000):
        self.tg = threadgroup.ThreadGroup(threads)

        # signal that the service is done shutting itself down:
        self._done = event.Event()