timeout,ruff
All checks were successful
deploy / deploy (push) Successful in 1m7s

This commit is contained in:
Untone 2023-10-17 18:22:05 +03:00
parent 7a561603ed
commit 878c0dc216
2 changed files with 13 additions and 2 deletions

View File

@ -21,6 +21,7 @@ itsdangerous = "^2.1.2"
[tool.poetry.dev-dependencies]
pytest = "^7.4.2"
black = { version = "^23.9.1", python = ">=3.12" }
ruff = { version = "^0.1.0", python = ">=3.12" }
[tool.black]
line-length = 120
@ -53,3 +54,13 @@ force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 120
[tool.ruff]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
ignore = []
line-length = 120
target-version = "py312"

View File

@ -4,7 +4,7 @@ from httpx import AsyncClient, HTTPError
from settings import AUTH_URL
INTERNAL_AUTH_SERVER = "v2.discours" in AUTH_URL or "testapi.discours" in AUTH_URL
INTERNAL_AUTH_SERVER = "auth.discours.io" not in AUTH_URL
async def check_auth(req):
@ -23,7 +23,7 @@ async def check_auth(req):
"variables": None,
}
async with AsyncClient() as client:
async with AsyncClient(timeout=30.0) as client:
response = await client.post(AUTH_URL, headers=headers, json=gql)
print(f"[services.auth] response: {response.status_code} {response.text}")
if response.status_code != 200: