Skip to content

Commit

Permalink
Removes unused max_delay variable & other related variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndiritu committed Dec 2, 2024
1 parent 886f28e commit 48224f0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/http/httpx/kiota_http/middleware/retry_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ async def send(self, request: httpx.Request, transport: httpx.AsyncBaseTransport
_span.set_attribute("com.microsoft.kiota.handler.retry.enable", True)
_span.end()
retry_valid = current_options.should_retry
max_delay = current_options.max_delay
_retry_span = self._create_observability_span(
request, f"RetryHandler_send - attempt {retry_count}"
)
while retry_valid:
start_time = time.time()
response = await super().send(request, transport)
_retry_span.set_attribute(HTTP_RESPONSE_STATUS_CODE, response.status_code)
# check that max retries has not been hit
Expand All @@ -97,8 +95,6 @@ async def send(self, request: httpx.Request, transport: httpx.AsyncBaseTransport
should_retry = self.should_retry(request, current_options, response)
if all([should_retry, retry_valid, delay < RetryHandlerOption.MAX_DELAY]):
time.sleep(delay)
end_time = time.time()
max_delay -= (end_time - start_time)
# increment the count for retries
retry_count += 1
request.headers.update({'retry-attempt': f'{retry_count}'})
Expand Down

0 comments on commit 48224f0

Please sign in to comment.