def get_job_result_from_redis(self, job): try: if self.r.exists(job.job_result_key_cached): val = dill_loads(self.r.get(job.job_result_key_cached)) else: val = dill_loads(self.r.get(job.job_result_key)) except Exception as e: raise e
def job_get_result(job, redis_connection): val = None try: if job.memoized and redis_connection.exists(job.jobkey_cached): val = dill_loads(redis_connection.get(job.jobkey_cached)) else: val = dill_loads(redis_connection.get(job.jobkey)) except Exception as e: print("[-] error getting job result: ", e) return val
def get_job_result(self, job, raise_exception=False): if raise_exception and job.state == JobState.FAILURE: job.safe_to_collect = True self.save_job(job) raise RuntimeError(job.error) job = tm.get_job(job.job_key) val = None try: if job.memoized and self.r.exists(job.job_result_key_cached): val = dill_loads(self.r.get(job.job_result_key_cached)) else: val = dill_loads(self.r.get(job.job_result_key)) except Exception as e: print("[-] error getting job result: ", e) job.safe_to_collect = True self.save_job(job) return val
def loadObject(obj): try: return dill_loads(obj) except (UnpicklingError, ): raise LoadError(dill.__name__)
def job_loads(data): return dill_loads(data)
def getfn(self): return dill_loads(self.fun)