Exemplo n.º 1
0
 def loop(self, now=None):
     now = now or self.get_now()
     self._logger.debug('Checking periodic command registry')
     start = time.time()
     for task in registry.get_periodic_tasks():
         if task.validate_datetime(now):
             self._logger.info('Scheduling %s for execution' % task)
             self.enqueue(task)
     time.sleep(60 - (time.time() - start))
Exemplo n.º 2
0
    def loop(self, now=None):
        now = now or self.get_now()
        self._logger.debug('Checking periodic command registry')
        start = time.time()
        for task in registry.get_periodic_tasks():
            if task.validate_datetime(now):
                self._logger.info('Scheduling %s for execution' % task)
                self.enqueue(task)

        self.sleep_for_interval(start)
Exemplo n.º 3
0
def list_registered():
    print("- Registered tasks")
    for task in registry.get_periodic_tasks():
        print("-> {}".format(task.name))
Exemplo n.º 4
0
def list_registered():
    print("- Registered tasks")
    for task in registry.get_periodic_tasks():
        print("-> {}".format(task.name))
Exemplo n.º 5
0
Arquivo: api.py Projeto: deathowl/huey
 def read_periodic(self, ts):
     periodic = registry.get_periodic_tasks()
     return [task for task in registry.get_periodic_tasks()
             if task.validate_datetime(ts)]
Exemplo n.º 6
0
 def read_periodic(self, ts):
     periodic = registry.get_periodic_tasks()
     return [task for task in periodic
             if task.validate_datetime(ts)]