Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Cannot upload file in local mode due to idleTimeout #224

Open
NyaMisty opened this issue Jan 10, 2022 · 4 comments
Open

[Bug] Cannot upload file in local mode due to idleTimeout #224

NyaMisty opened this issue Jan 10, 2022 · 4 comments

Comments

@NyaMisty
Copy link

I'm using telegram-bot-api in local mode so that I can directly let it uploading file from disk by passing file:// url to send_document.

However, when the bandwidth is limited, upload can take a long time like 30 minutes, and that means 30 minutes' idle time waiting for file upload on that connection.

But the idleTimeout is only 500 seconds. That makes the file upload request of big file are never responded, whereas file are still being uploaded.

@levlam
Copy link
Contributor

levlam commented Jan 11, 2022

The file will be sent anyway, just the answer will not be sent. But if a request needs more than 8 minutes to complete, then the bot is barely usable. And everything will be much worse, if the bot would be used by more than one user. So, increasing the limit makes no sense generally, but if you really need a bigger limit, you can change it in

20, 500, creator_(), scheduler_id)
.

@NyaMisty
Copy link
Author

NyaMisty commented Jan 11, 2022 via email

@aliforever
Copy link

aliforever commented Mar 11, 2022

@levlam I'm running into the similar problem as well. When multiple clients request to download a file from Telegram, it takes more than 10 minutes to do so. Then requests are timed-out with EOF error.

I believe an argument for setting the time-out when starting the server is essential.

The solution I'm trying to use now is to constantly check for download folder to see if new files are added. But that's a terrible solution.

@ZhangYiQiu
Copy link

ZhangYiQiu commented Jan 11, 2024

You can view the my fork project, it support use http proxy and setup idle-timeout parameters.

ZhangYiQiu/telegram-bot-api

add http proxy parameters

--enable-http-proxy             Enable HTTP proxy
--http-proxy-ip=<arg>           HTTP proxy ip (default is 127.0.0.1)
--http-proxy-port=<arg>         HTTP proxy port (default is 4780)

add idle timeout parameters

--idle-timeout=<arg>             idle timeout (default is 500)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants