def analytics_task(default_retry_delay=10, max_retries=3, queue='background_queue'):
    def decorator(func):
        @task(bind=True, queue=queue, ignore_result=True, acks_late=True,
              default_retry_delay=default_retry_delay, max_retries=max_retries)
        @wraps(func)
        def _inner(self, *args, **kwargs):
            try:
                return func(*args, **kwargs)
            except requests.exceptions.HTTPError as e:
                # if its a bad request, raise the exception because it is our fault
                res = e.response
                status_code = res.status_code if isinstance(res, requests.models.Response) else res.status
                if status_code == 400:
                    raise
                else:
                    self.retry(exc=e)
        return _inner
    return decorator
defines a task that posts data to one of our analytics endpoints. It retries the task
dataset/ETHPy150Open dimagi/commcare-hq/corehq/util/decorators.py/analytics_task