dbcron/management/commands/crond.py
def main(self, executor, tags, **kwargs):
        """Infinite loop acting as cron daemon."""
        # Lazy filtering
        jobs = models.Job.objects.filter(is_active=True)
        if tags:
            jobs = jobs.filter(tag__in=tags)
        self.stdout.write(self.style.SUCCESS('Started'))
        # Main Loop
        while True:
            self.logger.debug("new loop")
            executor.map(self.run_job, jobs.all())
            if self.stop():
                break
            time.sleep(1)
Infinite loop acting as cron daemon.
Infinite loop acting as cron daemon.
Infinite loop acting as cron daemon .
def main(self, executor, tags, **kwargs):
        jobs = models.Job.objects.filter(is_active=True)
        if tags:
            jobs = jobs.filter(tag__in=tags)
        self.stdout.write(self.style.SUCCESS('Started'))
        while True:
            self.logger.debug("new loop")
            executor.map(self.run_job, jobs.all())
            if self.stop():
                break
            time.sleep(1)
def main ( self , executor , tags , ** kwargs ) : jobs = models . Job . objects . filter ( is_active = True ) if tags : jobs = jobs . filter ( tag__in = tags ) self . stdout . write ( self . style . SUCCESS ( 'Started' ) ) while True : self . logger . debug ( "new loop" ) executor . map ( self . run_job , jobs . all ( ) ) if self . stop ( ) : break time . sleep ( 1 )
Infinite loop acting as cron daemon.
Infinite loop acting as cron daemon .
"""Infinite loop acting as cron daemon.""" # Lazy filtering # Main Loop
self
executor
tags