Skip to content

Commit

Permalink
test this on stage
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-sentry committed Oct 25, 2024
1 parent c5b5a8f commit 4bec180
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions graphql_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import socket
import time
from asyncio import iscoroutine
from asyncio import iscoroutine, wait_for
from typing import Any, Collection, Optional

import regex
Expand Down Expand Up @@ -239,7 +239,12 @@ async def post(self, request, *args, **kwargs):
)

with RequestFinalizer(request):
response = await super().post(request, *args, **kwargs)
try:
response = await wait_for(
super().post(request, *args, **kwargs), timeout=3
)
except TimeoutError:
return JsonResponse({"error": "Request timed out"}, status=408)

Check warning on line 247 in graphql_api/views.py

View check run for this annotation

Codecov Notifications / codecov/patch

graphql_api/views.py#L246-L247

Added lines #L246 - L247 were not covered by tests

content = response.content.decode("utf-8")
data = json.loads(content)
Expand Down

0 comments on commit 4bec180

Please sign in to comment.