Skip to content
New issue

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

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

Already on GitHub? # to your account

Only use http1.1 #189

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:
run: ulimit -a

- name: Build docker
run: docker-compose -f docker/docker-compose.yml build --build-arg BASE_IMG=python:${{ matrix.python-version }} --no-cache
run: docker compose -f docker/docker-compose.yml build --build-arg BASE_IMG=python:${{ matrix.python-version }} --no-cache

- name: Run unit tests
run: docker-compose -f docker/docker-compose.yml run --rm unit-test
run: docker compose -f docker/docker-compose.yml run --rm unit-test

- name: Run integration tests
run: docker-compose -f docker/docker-compose.yml run --rm integration-test
run: docker compose -f docker/docker-compose.yml run --rm integration-test

- name: Generate coverage html report with dynamic contexts
run: docker-compose -f docker/docker-compose.yml run --rm coverage
run: docker compose -f docker/docker-compose.yml run --rm coverage

- uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions fauna/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def __init__(
from fauna.http.httpx_client import HTTPXClient
c = HTTPXClient(
httpx.Client(
http1=False,
http2=True,
http1=True,
http2=False,
timeout=httpx.Timeout(
timeout=timeout_s,
connect=connect_timeout_s,
Expand Down
22 changes: 4 additions & 18 deletions fauna/http/httpx_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,12 @@ def request(
raise ClientError("Invalid URL Format") from e

try:
return HTTPXResponse(self._send_with_retry(3, request))
except (httpx.HTTPError, httpx.InvalidURL) as e:
raise NetworkError("Exception re-raised from HTTP request") from e

def _send_with_retry(
self,
retryCount: int,
request: httpx.Request,
) -> httpx.Response:
try:
response = self._c.send(
return HTTPXResponse(self._c.send(
request,
stream=False,
)
return response
except httpx.TransportError as e:
if retryCount == 0:
raise e
else:
return self._send_with_retry(retryCount - 1, request)
))
except (httpx.HTTPError, httpx.InvalidURL) as e:
raise NetworkError("Exception re-raised from HTTP request") from e

@contextmanager
def stream(
Expand Down
Loading