Skip to content

Commit

Permalink
Fixes #34345 - rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
rverdile committed Feb 1, 2022
1 parent 4a363fd commit a736ec9
Show file tree
Hide file tree
Showing 167 changed files with 161,198 additions and 147,385 deletions.
1 change: 1 addition & 0 deletions app/models/setting/content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def self.default_settings
100, N_('Batch size to sync repositories in.')),
self.set('foreman_proxy_content_auto_sync', N_("Whether or not to auto sync the Smart Proxies after a Content View promotion."),
true, N_('Sync Smart Proxies after Content View promotion')),
self.set('download_rate_limit', N_("Maximum download rate when syncing a repository (requests per second). Use 0 for no limit."), 0, N_("Download rate limit")),
self.set('default_download_policy', N_("Default download policy for custom repositories (either 'immediate' or 'on_demand')"), "immediate",
N_('Default Custom Repository download policy'), nil, :collection => download_policies),
self.set('default_redhat_download_policy', N_("Default download policy for enabled Red Hat repositories (either 'immediate' or 'on_demand')"), "on_demand",
Expand Down
3 changes: 2 additions & 1 deletion app/services/katello/pulp3/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ def common_remote_options
proxy_url: root.http_proxy&.url,
proxy_username: root.http_proxy&.username,
proxy_password: root.http_proxy&.password,
total_timeout: Setting[:sync_connect_timeout]
total_timeout: Setting[:sync_connect_timeout],
rate_limit: Setting[:download_rate_limit]
}
remote_options[:url] = root.url unless root.url.blank?
remote_options[:download_concurrency] = root.download_concurrency unless root.download_concurrency.blank?
Expand Down

0 comments on commit a736ec9

Please sign in to comment.