import time


def fetch_retry(headers, func, *args):
    """Error 429 from Azure is from throttling.  This will wait the allotted time and retry the fetch."""
    if "Retry-After" in headers:
        time.sleep(headers["Retry-After"])
        return func(*args)
    else:
        time.sleep(30)
        return func(*args)