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

client: Add support for download_timeout, user_agent and aggr_proxy #7

Merged
merged 1 commit into from
Apr 18, 2019

Conversation

avgerin0s
Copy link
Member

@avgerin0s avgerin0s commented Apr 12, 2019

  • download_timeout option is used to define the maximum time to wait for a
    resource download. If unset the downloader does not use a timeout.

  • user_agent option is used to define the User-Agent string to use
    for a resource download. If unset the downloader service uses its
    preconfigured value.

  • aggr_proxy option is used to define the HTTP proxy to use for a
    resource download. If unset the downloader ues no HTTP proxy for the
    download.

# @param aggr_timeout [Integer] the maximum time to wait for the resource
# to be downloaded in seconds, by default it uses the timeout set in
# the downloader's configuration
# @param aggr_useragent [String] the User-Agent string to use for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This depends on the downloader implementation, however since we have no PR for that yet I'll write it here.

I believe we shouldn't limit this feature to the "User-Agent" header - we should allow setting any header the user wants. It might be a little bit more work to implement, but it's worth the effort. Otherwise, we'll have to change the code in downloader and ferto every time we want to set another header.

Also, is there a reason to tie this to the Aggregation, as opposed to the Job?

@avgerin0s avgerin0s changed the title client: Add support for aggr_timeout, aggr_useragent and aggr_proxy client: Add support for download_timeout, user_agent and aggr_proxy Apr 17, 2019
Copy link

@0xdiba 0xdiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Let's have a link to the feature PR just for reference: skroutz/downloader#14

lib/ferto/client.rb Outdated Show resolved Hide resolved
- `download_timeout` option is used to define the maximum time to wait for a
  resource download. If unset the downloader service does not use a
  timeout.

- `user_agent` option is used to define the User-Agent string to use
  for a resource download. If unset the downloader service uses its
  preconfigured value.

- `aggr_proxy` option is used to define the HTTP proxy to use for a
   resource download. If unset the downloader decides whether to use a
   proxy or not based on the environment variables like HTTP_PROXY and
   HTTPS_PROXY
@avgerin0s avgerin0s merged commit d8f3e7c into master Apr 18, 2019
@0xdiba 0xdiba deleted the client-opts branch April 18, 2019 10:29
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

Successfully merging this pull request may close these issues.

5 participants