Skip to content

Commit

Permalink
Enabled rate_limit option on the remote.
Browse files Browse the repository at this point in the history
closes #9607
  • Loading branch information
ipanova committed Dec 9, 2021
1 parent 3de4132 commit 39b3000
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/9607.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enabled rate_limit option on the remote. Rate limit defines N req/sec per connection.
2 changes: 2 additions & 0 deletions pulp_container/app/downloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ async def _run(self, handle_401=True, extra_data=None):
headers.update(auth_headers)
# aiohttps does not allow to send auth argument and auth header together
self.session._default_auth = None
if self.download_throttler:
await self.download_throttler.acquire()
async with self.session.get(
self.url, headers=headers, proxy=self.proxy, proxy_auth=self.proxy_auth
) as response:
Expand Down

0 comments on commit 39b3000

Please sign in to comment.