Похожие чаты

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 ответов

5 просмотров

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 ] Автор вопроса
カルロサグ-[ 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 ] Автор вопроса
カルロサグ [ 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

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

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

Hi everyone! I have a two-folded message to share today. First: updates and news, as we are being asked for those. We still want to go like we did the last 6 years: we w...
Marten | Unibright.io
24
generic procedure function test<T>(param: T); type case T of longint: NewT = word; longword: NewT = byte; end; var v1: NewT; Как это можно сделать? Чтобы у меня...
notme
21
Интересно, нет ли какого-то способа получить из dll не адрес самой метки, а адрес со смещением?
The Bird of Hermes
54
Guys, mexc or gate.io (only exchanges with the token I need, unfortunately): depositing xmr, not withdrawing, is safe rn, or can fall for shotgun kyc? (I heard gate is alread...
another one bites the dust
18
Whoa, did you guys see this FUNToken Seed Grant announcement? 💸
Noah Noure
37
Делал задачу вот такую https://stepik.org/lesson/4985/step/9?unit=1083 получилось такое https://play.haskell.org/saved/ipKrepqe оно работает, тестов много не писал, но работае...
Fedor
22
hello guys, I have a laptop, if you connect wired headphones, the sound will come from the headphones and the built-in speakers AT THE SAME TIME. How can I make the sound com...
El Pepe
21
hello, does someone have a good cheat sheet (max 2 sides of A4 paper sheet) for C only? I need it to cover most useful function for math, dynamic memory, strings, files (I/O),...
狐 - えんきどぅ
19
Всем привет, все время юзал бандлы, но появилась задача по базовому образу и команда werf build не пушит образ werf build --config='./root/werf.yaml' --repo ${CI_REGISTRY_IMAG...
Илья Корж
4
А можно как-нибудь включить default'ные настройки ядра?
Ari
26
Карта сайта