Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(http_session): add opt. requests timeout parameter #128

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pballandras
Copy link

@pballandras pballandras commented Sep 18, 2023

Users can now specify after how much time a request should timeout. This new parameter prevents the default "hang forever" behaviour requests has.

The idea here is that if the user feels like it's taking to long, they can change strategy or fail faster.

This comes from a problem we faced using the Lacework python-sdk where a request took 8 minutes to finally give us a 504. It's not the end of the world, but this could be an easy, free fix.

Cheers!

Users can now specify after how much time a request should timeout.
This new parameter will prevent the default "hang forever" behaviour
request has.
@@ -20,6 +20,7 @@
from laceworksdk.exceptions import ApiError, MalformedResponse, RateLimitError

logger = logging.getLogger(__name__)
HTTP_REQUEST_DEFAULT_TIMEOUT_SEC = 30
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you feel like this is too short, feel free to ask me to change it.

@pballandras pballandras marked this pull request as ready for review September 18, 2023 19:33
@pballandras pballandras requested a review from a team as a code owner September 18, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant