Skip to content

Commit

Permalink
fix/increase-auth-timeout: increase timeout to 5s (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpulver authored Aug 26, 2024
1 parent 66deeea commit 6664d76
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion safety/auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,14 @@ def initialize_scan(self) -> Any:
Returns:
Any: The initialization result.
"""
return self.get(url=PLATFORM_API_INITIALIZE_SCAN_ENDPOINT, timeout=2)
try:
response = self.get(url=PLATFORM_API_INITIALIZE_SCAN_ENDPOINT, timeout=5)
return response
except requests.exceptions.Timeout:
LOG.error("Auth request to initialize scan timed out after 5 seconds.")
except Exception as e:
LOG.exception("Exception trying to auth initialize scan", exc_info=True)
return None

class S3PresignedAdapter(HTTPAdapter):
def send(self, request: requests.PreparedRequest, **kwargs: Any) -> requests.Response:
Expand Down

0 comments on commit 6664d76

Please sign in to comment.