Skip to content

Commit

Permalink
add AsyncRequester's increase_rate
Browse files Browse the repository at this point in the history
  • Loading branch information
zrquan committed Sep 8, 2024
1 parent 01ff69c commit 96ed5d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/connection/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ async def request(self, path: str, proxy: str = None) -> AsyncResponse:
# Use "target" extension to avoid the URL path from being normalized
request = self.session.build_request(
options["http_method"],
# url.removesuffix(parsed_url.path),
url,
headers=self.headers,
data=options["data"],
Expand Down Expand Up @@ -395,3 +394,7 @@ async def request(self, path: str, proxy: str = None) -> AsyncResponse:
err_msg = f"There was a problem in the request to: {url}"

raise RequestException(err_msg)

def increase_rate(self) -> None:
self._rate += 1
asyncio.get_running_loop().call_later(1, self.decrease_rate)

0 comments on commit 96ed5d8

Please sign in to comment.