def on_timeout(self, soft, timeout): """Handler called if the task times out.""" task_ready(self) if soft: warn('Soft time limit (%ss) exceeded for %s[%s]', timeout, self.name, self.id) exc = exceptions.SoftTimeLimitExceeded(timeout) else: error('Hard time limit (%ss) exceeded for %s[%s]', timeout, self.name, self.id) exc = exceptions.TimeLimitExceeded(timeout) if self.store_errors: self.task.backend.mark_as_failure(self.id, exc)
def on_timeout(self, soft, timeout): """Handler called if the task times out.""" state.task_ready(self) if soft: self.logger.warning("Soft time limit (%ss) exceeded for %s[%s]" % (timeout, self.task_name, self.task_id)) exc = exceptions.SoftTimeLimitExceeded(timeout) else: self.logger.error("Hard time limit (%ss) exceeded for %s[%s]" % (timeout, self.task_name, self.task_id)) exc = exceptions.TimeLimitExceeded(timeout) if self._store_errors: self.task.backend.mark_as_failure(self.task_id, exc)