diff --git a/rq/job.py b/rq/job.py index b820f79..2b34109 100644 --- a/rq/job.py +++ b/rq/job.py @@ -497,11 +497,14 @@ class Job(object): self.ttl = -1 _job_stack.push(self.id) try: - self._result = self.func(*self.args, **self.kwargs) + self._result = self._execute() finally: assert self.id == _job_stack.pop() return self._result + def _execute(self): + return self.func(*self.args, **self.kwargs) + def get_ttl(self, default_ttl=None): """Returns ttl for a job that determines how long a job will be persisted. In the future, this method will also be responsible