-
|
so I'm downloading certain data from an API, I'm going for streaming since their server cluster randomly closes connections. this is just a sketch of what I'm doing, I plan on reworking it later for better logging and skipping downloaded files, but I want to test what happens if the connection fails for whatever reason, but i never used streaming before. Process, three levels of loops, project, dates, endpoints. inside those, I want to stream the call to those files, if I get 200 then just write. if I get 429 sleep for 61 seconds and retry. if 504 (connection closed at their end), sleep 61s, consume one retry anything else, throw the exception, sleep 61s and consume one retry I tried forcing 429 by calling that thing seven times (supposed to be 4 requests per minutes), but it isn't happening, and I need a sanity check. I'd also probably need to async this at project level thing but that's a level of complexity that I don't need now (each project have its own different limit) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
@M2ATrail you probbaly looking for https://github.com/encode/httpx |
Beta Was this translation helpful? Give feedback.
@M2ATrail you probbaly looking for https://github.com/encode/httpx