def worker(): while True: job = jobq.get() TIMING_LOG.info("%s started" % str(job.context_str)) try: job.start() except: err = StringIO() traceback.print_exc(file=err) _LOG.error("Worker dying. Error in job.start = %s" % err.getvalue()) else: try: job.get_results() except: err = StringIO() traceback.print_exc(file=err) _LOG.error("Worker dying. Error in job.get_results = %s" % err.getvalue()) TIMING_LOG.info("%s completed" % str(job.context_str)) jobq.task_done() return
def put(self, job): TIMING_LOG.info("%s queued" % str(job.context_str)) Queue.put(self, job)