def check_errors(self): if self.state == enums.JobStateEnum.COMPLETED: return True elif self.state in (enums.JobStateEnum.FAILED, enums.JobStateEnum.ROLLING_BACK, enums.JobStateEnum.COMPLETED_WITH_ERROR): raise ex.JobStateError(self) return False
def _do_update(): job.update() if job.state == enums.JobStateEnum.COMPLETED: return True elif job.state in (enums.JobStateEnum.FAILED, enums.JobStateEnum.ROLLING_BACK, enums.JobStateEnum.COMPLETED_WITH_ERROR): raise ex.JobStateError(job) return False
def _do_update(job): if not update_func: job.update() else: job = update_func(job) if job.state == enums.JobStateEnum.COMPLETED: return job elif job.state in (enums.JobStateEnum.FAILED, enums.JobStateEnum.ROLLING_BACK, enums.JobStateEnum.COMPLETED_WITH_ERROR): raise ex.JobStateError(job) return False