'Checks on whether the task instance is in the right state and timeframe
to be retried.'

def ready_for_retry(self):

    return ((self.state == State.UP_FOR_RETRY) and (self.next_retry_datetime() < datetime.now()))
