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

Set connection timeout for curl #4884

Merged
merged 2 commits into from
Sep 25, 2022
Merged

Set connection timeout for curl #4884

merged 2 commits into from
Sep 25, 2022

Conversation

yubiuser
Copy link
Member

What does this PR aim to accomplish?:

Sets the --connection-timeout for the gravity curl (downloading adlists) to 10 seconds.
From the man pages:

       --connect-timeout <seconds>
              Maximum  time  in  seconds  that  you allow curl's connection to
              take.  This only limits the connection phase, so  if  curl  con‐
              nects  within the given period it will continue - if not it will
              exit.  Since version 7.32.0, this option accepts decimal values.

              If this option is used several times, the last one will be used.

              See also -m, --max-time.

This should speed up speed up gravity runs with a lot of inaccessible adlists. This was discussed on discourse: https://discourse.pi-hole.net/t/gravity-update-timeout/57391

The default timeout is 5 minutes.
https://github.com/curl/curl/blob/e43c3b3e3e6c2d58084d8c98f8e9640e09c0a05e/lib/connect.h#L47

#define DEFAULT_CONNECT_TIMEOUT 300000 /* milliseconds == five minutes */

By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

@yubiuser yubiuser added Feature Request General Feature Requests Discussion labels Aug 31, 2022
@yubiuser yubiuser requested a review from a team August 31, 2022 09:15
Signed-off-by: Christian König <ckoenig@posteo.de>
Signed-off-by: Christian König <ckoenig@posteo.de>
@dschaper dschaper added the PR: Approved Open Pull Request, Approved by required number of reviewers label Sep 25, 2022
@dschaper dschaper merged commit a8ce135 into development Sep 25, 2022
@dschaper dschaper deleted the curl_timeout branch September 25, 2022 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Feature Request General Feature Requests PR: Approved Open Pull Request, Approved by required number of reviewers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants