def main(): while True: #rotation function changes/updates the states and submits jobs #that were created try: job.status() job.rotate() except Exception, e: if config.email.send_on_crash: msg = '*** Job pooler has crashed! ***\n\n' msg += 'Fatal error occured while running job pool: %s\n\n' % str(e) msg += ''.join(traceback.format_exception(*sys.exc_info())) notification = mailer.ErrorMailer(msg).send() sys.stderr.write("Fatal error occurred!\n") raise time.sleep(config.background.sleep)
def main(): while True: #rotation function changes/updates the states and submits jobs #that were created try: job.status() job.rotate() except Exception, e: if config.email.send_on_crash: msg = '*** Job pooler has crashed! ***\n\n' msg += 'Fatal error occured while running job pool: %s\n\n' % str( e) msg += ''.join(traceback.format_exception(*sys.exc_info())) notification = mailer.ErrorMailer(msg).send() sys.stderr.write("Fatal error occurred!\n") raise time.sleep(config.background.sleep)
def main(): while True: #rotation function changes/updates the states and submits jobs #that were created try: job.update_jobs_status_from_queue() pipeline_utils.move_results() job.update_jobs_status_from_queue() job.status() job.rotate() #pipeline_utils.archive_logs() except Exception, e: if config.email.send_on_crash: msg = '*** Job pooler has crashed! ***\n\n' msg += 'Fatal error occured while running job pool: %s\n\n' % str( e) msg += ''.join(traceback.format_exception(*sys.exc_info())) notification = mailer.ErrorMailer(msg, subject="Job Pooler crash!") notification.send() sys.stderr.write("Fatal error occurred!\n") raise time.sleep(config.background.sleep)
import job """ This script displays number of jobs processed, uploaded, waiting, waiting retry, failed. """ job.status(False)