cached-request-2
All checks were successful
deploy / deploy (push) Successful in 1m4s

This commit is contained in:
2023-12-19 19:04:35 +03:00
parent 6c7f269206
commit 92791efa9c
2 changed files with 6 additions and 3 deletions

View File

@@ -7,10 +7,15 @@ from settings import API_BASE
@lru_cache(maxsize=128, typed=True)
def _request_endpoint(query_name, body) -> Any:
def __request_endpoint(query_name, body) -> requests.Response:
print(f"[services.core] requesting {query_name}...")
response = requests.post(API_BASE, headers={"Content-Type": "application/json"}, json=body)
print(f"[services.core] {query_name} response: <{response.status_code}> {response.text[:65]}..")
return response
def _request_endpoint(query_name, body) -> Any:
response = __request_endpoint(query_name, body)
if response.status_code == 200:
try: