def run(self, pidfile, programname, timeinterval): """ This method runs the danaJob every timeinterval subject to the constraint that if force is True, we process all the images that were already processed. Keyword Arguments: pidfile -- Ensure that only one Application specific dana runs at a time. programname -- Name of the application specific dana. timeinterval -- an integer time in seconds after which to repeat dana """ if not getLock(pidfile, programname): return while True: try: self.log.info("Running Gmail Result Mailer", extra=self.grestags) self.checkResults() self.log.info("Done Running Gmail Result Mailer", extra=self.grestags) except Exception, err: self.log.critical("Error Checking Results " + str(err) + " :: " + traceback.format_exc(), extra=self.grestags) if timeinterval >= 0: time.sleep(timeinterval) else: sys.exit(0)
def run(self, pidfile, programname, timeinterval): """ This method runs the danaJob every timeinterval subject to the constraint that if force is True, we process all the images that were already processed. Keyword Arguments: pidfile -- Ensure that only one Application specific dana runs at a time. programname -- Name of the application specific dana. timeinterval -- an integer time in seconds after which to repeat dana """ if not getLock(pidfile, programname): return while True: self.log.info("Running Data ANAlysis", extra=self.danatags) exitcode, err = self.danaJob() self.log.info("Done Running Data ANAlysis", extra=self.danatags) if exitcode is not ExitCode.Success: self.log.critical("computation cycle failed" + err, extra=self.danatags) if timeinterval >= 0: time.sleep(timeinterval) else: sys.exit(0)