Похожие чаты

Is there a way to use iter_download() with a timeout

(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

10 ответов

14 просмотров

Can you show some of your current code structure

カルロサグ-[ GOT 'EM ] Автор вопроса
⎞ .·. ⎝ ⎝
Can you show some of your current code structure

it's pretty much the same as the documentation lemme do a paste pls wait

カルロサグ-[ GOT 'EM ] Автор вопроса

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

カルロサグ-[ GOT 'EM ] Автор вопроса
⎞ .·. ⎝ ⎝
if I'm getting the issue correctly, so you can jus...

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

カルロサグ [ GOT 'EM ]
the built-in anext() function is not available in ...

what's wrong with the first one? the bound anext is same thing

カルロサグ [ GOT 'EM ]
you mean anext() ?

yeah, StopAsyncIteration means you reached the end

カルロサグ-[ GOT 'EM ] Автор вопроса
⎞ .·. ⎝ ⎝
yeah, StopAsyncIteration means you reached the end

yes, I finally understand how it works thanks for the help

Похожие вопросы

Обсуждают сегодня

Всем привет! Имеется функция: function IsValidChar(ch: UTF8Char): Boolean; var i: Integer; ValidChars: AnsiString; begin ValidChars := 'abcdefghijklmnopqrstuvwxyzABCDE...
Евгений
44
For all those that keep asking why no pump? why this ? and why that...? Please close ur ewt chart and open 2 others - TOTAL (total mc) and BTC.D (btc dominance). Maybe BTC a...
Inn3r_G
19
"Since pnut can flip FTM easily, I'm swapping my FTM to pnut and hoping for a easy x5-x10" Perfect recipe for disaster. NFA but chances are, you'll end up as exit liquidity ...
C. A.
7
AMD status update? No longer in the plan but something might be around the corner later on Chinese partner? No longer in the plan. This market does not seem to be the top ...
Ben
6
I get confused when people talk about the ‘bull market’ and the ‘next bull market’ as if anyone really has a clue what’s really going on in the world. First of all - there i...
Shah
1
И никого не интересует какие пакеты кто использует. ((% Заходишь на сайт симфони и видишь поддержку Украины - по законам РФ это ж экстремизм. Только никто не отказывается от с...
Am Ambrion
11
Мне вот любопытно. Уже сколько времени имею соблазн купить макбук, ибо подозреваю что очень уж удобен будет в связке с другой техникой от эпл которая у меня есть, да и сам по ...
Not Yeromin
9
Ready for some fun AND a chance to win TKO Tokens? Join us for exciting minigames in our Telegram group! 🕒 Don’t miss out—games start on today 25 October 2024, at 8 PM! Ge...
Milkyway | Tokocrypto
255
Добрый день, подскажите, пожалуйста, по проблеме. Сегодня на работе утром обнаружилось что по рдп подключиться не получается к серверу 2022. В серверную зашел - на системно...
srv
19
лучше скажите, причём тут паскаль?
Alexey Kulakov
36
Карта сайта