(something similar to a sock read timeout) ? I've read the docs but I could not find anything
I'm having 0 bytes per sec speeds with certain telegram files
it takes for ever for the client to get a single chunk
Can you show some of your current code structure
it's pretty much the same as the documentation lemme do a paste pls wait
https://pastebin.com/k39bELWA
if I'm getting the issue correctly, so you can just cancel the nex iter if took too too long with wait_for, roughly: async with aiofiles.open(...) as f: req = iter_download(...) while True: try: try: chunk = await asyncio.wait_for(anext(req), timeout=x) # Seconds if user_process_ifcancel(user_id): break await f.write(chunk) except asyncio.TimeoutError: # Chunk took long except StopAsyncIteration: break # Finish
I'll try this out thanks
the built-in anext() function is not available in version 3.9 So I ended up trying out other methods available https://pastebin.com/wsSXQGTD they did not work
what's wrong with the first one? the bound anext is same thing
you mean anext() ?
yeah, StopAsyncIteration means you reached the end
yes, I finally understand how it works thanks for the help
Обсуждают сегодня