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

Add a global 20 seconds timeout to middleware requests #2237

Closed
sainak opened this issue Jun 5, 2024 · 3 comments
Closed

Add a global 20 seconds timeout to middleware requests #2237

sainak opened this issue Jun 5, 2024 · 3 comments
Assignees
Labels
P0 Urgent

Comments

@sainak
Copy link
Member

sainak commented Jun 5, 2024

def api_post(self, url, data=None):
req = requests.post(
url,
json=data,
headers=self.get_headers(),
)
try:
response = req.json()
if req.status_code >= 400:
raise APIException(response, req.status_code)
return response
except json.decoder.JSONDecodeError:
raise APIException({"error": "Invalid Response"}, req.status_code)
def api_get(self, url, data=None):
req = requests.get(
url,
params=data,
headers=self.get_headers(),
)
try:
if req.status_code >= 400:
raise APIException(req.text, req.status_code)
response = req.json()
return response
except json.decoder.JSONDecodeError:
raise APIException({"error": "Invalid Response"}, req.status_code)

add a settings variable to set timeout for middleware requests
use 20 seconds as defaults

@sainak sainak added the P0 Urgent label Jun 5, 2024
@DraKen0009
Copy link
Contributor

@sainak I'll like to work on this issue

Copy link

sentry-io bot commented Sep 10, 2024

Sentry Issue: CARE-X6

@sainak
Copy link
Member Author

sainak commented Sep 25, 2024

completed in #2434

@sainak sainak closed this as completed Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 Urgent
Projects
Status: Done
Development

No branches or pull requests

2 participants