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

http.Client timeout. #36

Closed
sarg opened this issue Mar 21, 2019 · 5 comments
Closed

http.Client timeout. #36

sarg opened this issue Mar 21, 2019 · 5 comments

Comments

@sarg
Copy link

sarg commented Mar 21, 2019

Please set reasonable timeout for http.Client. As for now fdroidcl may show Downloading update... without displaying any progress.

@mvdan
Copy link
Owner

mvdan commented Mar 21, 2019

The default timeouts apply; see https://golang.org/pkg/net/http/#RoundTripper. For example, dialing stops after 30s, and the TLS handshake has 10s. There's no timeout on downloading the request body; otherwise, downloading a very large APK over a slow connection could error.

I agree that not reporting progress isn't ideal, but this is not an interactive tool. I think the underlying issue here is that f-droid.org can be very slow at times.

@sarg
Copy link
Author

sarg commented Mar 21, 2019

Okay then. I'll set global timeout in my script, given that I know how long update usually takes.
I agree that main use for fdroidcl is in non-interactive scenarios. But if you'll implement progress display like wget does it'll be nice.

 70%[=======================>                    ] 615.76K   886KB/s

@sarg sarg closed this as completed Mar 21, 2019
@Apfelwurm
Copy link

@sarg how did you set the global timeout? I've searched many times now and didn't find anything that would not involve code changes

@sarg
Copy link
Author

sarg commented Apr 4, 2022

@Apfelwurm I've meant something like https://www.man7.org/linux/man-pages/man1/timeout.1.html
You could do timeout 10s fdroidcl update

@Apfelwurm
Copy link

well, some things can be so simple :'D Thank you very much!

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

3 participants