Testing followup from office hours - Backoff Libra...
# singer-tap-development
v
Testing followup from office hours - Backoff Library from @michel_ebner 🧵
I saw
Copy code
def fatal_code(e):
    return 400 <= e.response.status_code < 500

@backoff.on_exception(backoff.expo,
                      requests.exceptions.RequestException,
                      max_time=300,
                      raise_on_giveup=False,
                      giveup=fatal_code)
def get_url(url):
    return requests.get(url)
from https://github.com/litl/backoff specifically
raise_on_giveup
is what I want to be False, but I only want it sometimes. ---- (Specifically for the SDK there's the decorator that @edgar_ramirez_mondragon wrote) https://gitlab.com/meltano/sdk/-/blob/main/singer_sdk/streams/rest.py#L163 that makes this one attractive if I could make it work