Skip to content

Commit c1d54ea

Browse files
committed
Close previous response before retry
1 parent ce11688 commit c1d54ea

File tree

1 file changed

+2
-0
lines changed
  • reportportal_client/_internal

1 file changed

+2
-0
lines changed

reportportal_client/_internal/http.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def __request(self, method: Callable, url: Union[str, bytes], **kwargs: Any) ->
6464
if result.status_code in AUTH_PROBLEM_STATUSES and self.__auth:
6565
refreshed_header = self.__auth.refresh()
6666
if refreshed_header:
67+
# Close previous result if it's retried to release resources
68+
result.close()
6769
# Retry with new auth header
6870
request_kwargs["headers"] = request_kwargs.get("headers", {}).copy()
6971
request_kwargs["headers"]["Authorization"] = refreshed_header

0 commit comments

Comments
 (0)