Skip to content

Commit

Permalink
fix/increase-auth-timeout: increase timeout to 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpulver committed Aug 26, 2024
1 parent 66deeea commit 15918da
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 15918da

Please sign in to comment.