From ba56007c879b41140d0ba78eeece2d99487f3ea1 Mon Sep 17 00:00:00 2001 From: Ina Panova Date: Mon, 6 Dec 2021 19:21:18 +0100 Subject: [PATCH] Fixed rate_limit option on the remote. backports #9607 closes #9610 (cherry picked from commit 39b3000150960c554d2124ab3654e3e7b4c54352) --- CHANGES/9610.bugfix | 2 ++ pulp_container/app/downloaders.py | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 CHANGES/9610.bugfix diff --git a/CHANGES/9610.bugfix b/CHANGES/9610.bugfix new file mode 100644 index 000000000..86f7cdf24 --- /dev/null +++ b/CHANGES/9610.bugfix @@ -0,0 +1,2 @@ +Fixed rate_limit option on the remote which was ignored during the downloads. Rate limit defines +N req/sec per connection ( backported from https://pulp.plan.io/issues/9610). diff --git a/pulp_container/app/downloaders.py b/pulp_container/app/downloaders.py index de5a2ffcb..73cca1787 100644 --- a/pulp_container/app/downloaders.py +++ b/pulp_container/app/downloaders.py @@ -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: