dbcron/management/commands/crond.py
def run_job(self, job):
        """Decides to run a job, launches it and handles errors."""
        # Time decision
        next_ = int(job.entry.next())
        if next_ != 0:
            self.logger.debug("%s will run in %ssec", job.name, next_)
            return
        # Run
        self.logger.info("started %s", job.name)
        try:
            result = job.run()
        except Exception as err:
            self.logger.exception("error with %s", job.name)
            raise
        finally:
            self.logger.info("finished %s", job.name)
        return result
Decides to run a job, launches it and handles errors.
Decides to run a job, launches it and handles errors.
Decides to run a job launches it and handles errors .
def run_job(self, job):
        next_ = int(job.entry.next())
        if next_ != 0:
            self.logger.debug("%s will run in %ssec", job.name, next_)
            return
        self.logger.info("started %s", job.name)
        try:
            result = job.run()
        except Exception as err:
            self.logger.exception("error with %s", job.name)
            raise
        finally:
            self.logger.info("finished %s", job.name)
        return result
def run_job ( self , job ) : next_ = int ( job . entry . next ( ) ) if next_ != 0 : self . logger . debug ( "%s will run in %ssec" , job . name , next_ ) return self . logger . info ( "started %s" , job . name ) try : result = job . run ( ) except Exception as err : self . logger . exception ( "error with %s" , job . name ) raise finally : self . logger . info ( "finished %s" , job . name ) return result
Decides to run a job, launches it and handles errors.
Decides to run a job launches it and handles errors .
"""Decides to run a job, launches it and handles errors.""" # Time decision # Run
self
job