How does sleep with backoff_factor work in Python requests? or Is sleep with backoff_factor the best

18 Replies, 1940 Views

Yo, thanks for all the replies! Didn’t expect so many good tips.

Tried the `tenacity` lib and it’s *so* much cleaner than my janky loop. Also, the `Retry-After` header tip saved me—turns out the API I’m using actually sends that.

One follow-up: How do you guys handle *non*-429 errors? Like, if the server’s just slow, do you still use backoff? Or is that overkill?

(Also, big shoutout to the person who mentioned jitter—never thought about that.)

🚀

Messages In This Thread



Users browsing this thread: 1 Guest(s)